diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4455419 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "includes/MathJax"] + path = includes/MathJax + url = https://github.com/mathjax/MathJax.git diff --git a/404.php b/404.php index a23240f..cab5b4a 100644 --- a/404.php +++ b/404.php @@ -18,42 +18,17 @@
- Si vous le voulez , vous pouvez essayer de trouver le code html de votre page web là dedans:
- - -
- -
- Plus -
- egg -
-

- - - - + ?> + - \ No newline at end of file + diff --git a/admin.php b/admin.php index 0b8346f..6ba7e70 100644 --- a/admin.php +++ b/admin.php @@ -1,6 +1,10 @@ connect ( $_SESSION ['session_mdp'] ); if ($me->isAdminLevelLowerThan ( 15 )) { @@ -10,167 +14,293 @@ if ($me->isAdminLevelLowerThan ( 15 )) { ?> - - - -La console d'admin - - - + + + + La console d'admin + + + + +
+
+ Commande : +
+
- - -
- -
- Objet

- -
- -
- Valeur
- -
- -
- -
- - Hello !!!
-
- - - - -
-
-
- - - - - -
Nom du champ
- - - -
- -
-
-
- + $('#commandSelector').change(updateCommandSelector); + + function updateAddCommandClassSelector(){ + $('div.addDivAttribute').hide(); + switch($('#addClassSelector').val()){ + case 'membre': + $('#addDivAttributeMembre').show(); + break; + case 'discussion': + $('#addDivAttributeDiscussion').show(); + break; + case 'message': + $('#addDivAttributeMessage').show(); + break; + case 'projet': + $('#addDivAttributeProjet').show(); + break; + case 'version': + $('#addDivAttributeVersion').show(); + break; + } + } + $('#addClassSelector').change(updateAddCommandClassSelector); + + updateCommandSelector(); + updateAddCommandClassSelector(); + + function addProjetAddPocesseur(){ + $('#addProjetAddPocesseur').before('Pocesseur :'); + $($('#addProjetAddPocesseur').prev().children()[0]).keyup(updateCommandOutput); + $('#addProjetAddPocesseur').before('') + $('#addProjetAddPocesseur').prev().click(addProjetRemovePocesseur); + $('#addProjetAddPocesseur').before('
'); + updateCommandOutput(); + } + $('#addProjetAddPocesseur').click(addProjetAddPocesseur); + + function addProjetRemovePocesseur(e){ + $(e.target).prev().remove(); + $(e.target).next().remove(); + $(e.target).remove(); + updateCommandOutput(); + } + $('.addProjetRemovePocesseur').click(addProjetRemovePocesseur); + + var commandMode = 'gui'; + function switchCommandMode(){ - - \ No newline at end of file + } + $('#switchMode').click(switchCommandMode); + + + + +
+
+ Commande :«...» + + +
+
+
+

Dialogue :

+ + Hello !!!
+
+
+ + + diff --git a/admindialog.php b/admindialog.php index 5b494b1..856ac07 100644 --- a/admindialog.php +++ b/admindialog.php @@ -154,7 +154,7 @@ $command=$_POST['command'].' '; $nommes=array(); $pos=0; while ($pos'; print_r($nommes); echo ''; -*/ function exception($reason){ echo 'An exception occurred : '.$reason; @@ -269,8 +267,7 @@ if($nommes[0][0] == 'a'){ } echo '
';
 			print_r($objectsToSet);
-			echo '
';+ - + echo ''; break; case 'DELETE': diff --git a/allein/pieces.php b/allein/pieces.php new file mode 100644 index 0000000..e774963 --- /dev/null +++ b/allein/pieces.php @@ -0,0 +1,156 @@ +
+ + + diff --git a/allein/univers.php b/allein/univers.php new file mode 100644 index 0000000..10f0da4 --- /dev/null +++ b/allein/univers.php @@ -0,0 +1,60 @@ + Si vous le voulez , vous pouvez essayer de trouver le code html de votre page web là dedans:
+ + +
+ Plus +

+
+
+ egg +

+ + + + + + diff --git a/change_password.php b/change_password.php deleted file mode 100644 index 7b206f5..0000000 --- a/change_password.php +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - -
Votre mot de passe à bien été changé !
- - - \ No newline at end of file diff --git a/clazz/Article.class.php b/clazz/Article.class.php new file mode 100644 index 0000000..730f744 --- /dev/null +++ b/clazz/Article.class.php @@ -0,0 +1,146 @@ +ID = $ID; + $req = $GLOBALS['bdd']->prepare('SELECT * FROM articles WHERE ID=?'); + $req->execute(array($ID)); + if($rep = $req->fetch()){ + $this->valid = TRUE; + $this->title = $rep['title']; + $this->short = $rep['short']; + $this->text = $rep['text']; + $this->postDate = $rep['postDate']; + $this->lastNoticeableChangeDate = $rep['lastNoticeableChangeDate']; + $this->lastChange = $rep['lastChange']; + $this->picPath = $rep['picPath']; + }else{ + $this->valid = FALSE; + } + } + + public function __toString(){ + $out = 'MegaStockage\n'; + $out .= '\tID:' . $this->ID . '\n'; + $out .= '\tTitle:' . $this->title . '\n'; + $out .= '\tShort description' . $this->short . '\n'; + $out .= '\tText:' . $this->text . '\n'; + $out .= '\tPost article date:' . $this->postDate . '\n'; + $out .= '\tLast noticeable change date:' . $this->lastNoticeableChangeDate . '\n'; + $out .= '\tLast change date:' . $this->lastChangeDate . '\n'; + $out .= '\tPic(ture) path:' . $this->picPath . '\n'; + return $out; + } + + public function exists(){ + return $this->valid; + } + + //Getters + + public function getID(){ + return $this->ID; + } + + public function setID($ID){ + $this->ID = $ID; + } + + public function getTitle(){ + return $this->title; + } + + public function setTitle($title){ + $this->title = $title; + } + + public function getShort(){ + return $this->short; + } + + public function setShort($short){ + $this->short = $short; + } + + public function getText(){ + return $this->text; + } + + public function setText($text){ + $this->text = $text; + } + + public function getPostDate(){ + return $this->postDate; + } + + public function setPostDate($postDate){ + $this->postDate = $postDate; + } + + public function getLastNoticeableChangeDate(){ + return $this->lastNoticeableChangeDate; + } + + public function setLastNoticeableChangeDate($lastNoticeableChangeDate){ + $this->lastNoticeableChangeDate = $lastNoticeableChangeDate; + } + + public function getLastChange(){ + return $this->lastChange; + } + + public function setLastChange($lastChange){ + $this->lastChange = $lastChange; + } + + public function getPicPath(){ + return $this->picPath; + } + + public function setPicPath($picPath){ + $this->picPath = $picPath; + } + //Useful getters + + //Gross getters + public static function getNewest($count){ + $req = $GLOBALS['bdd']->prepare('SELECT * FROM articles ORDER BY lastNoticeableChangeDate DESC LIMIT '.intval($count)); + $req->execute(); + $reps = array(); + $GLOBALS['bdd']->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + while($rep = $req->fetch()){ + $reps[] = new Article($rep['ID']); + } + return $reps; + + } + + //Setters + + // + + //Operateurs + + + + //Outputs texts + + +} + + + + + diff --git a/clazz/Discussion.class.php b/clazz/Discussion.class.php index fbd9b8c..0154606 100644 --- a/clazz/Discussion.class.php +++ b/clazz/Discussion.class.php @@ -16,7 +16,7 @@ class Discussion{ if($rep = $req->fetch()){ $this->valid = TRUE; $this->name = $rep['name']; - $this->creatorID = new Membre($rep['creatorID']); + $this->creator = new Membre($rep['creatorID']); $this->dateCreation = $rep['dateCreation']; $this->accessibility = $rep['accessibility']; }else{ @@ -35,7 +35,7 @@ class Discussion{ $out .= '\tCreator:{' . substr(str_replace('\n\t',';',$this->creator->__toString()),0,-1) . '}\n'; $out .= '\tDate of creation:' . $this->dateCreation . '\n'; $out .= '\tAccessibility:' . $this->accessibility . '\n'; - return out; + return $out; } //Getters @@ -48,7 +48,7 @@ class Discussion{ } public function getCreator(){ - return $creator; + return $this->creator; } public function getDateCreation(){ @@ -62,13 +62,24 @@ class Discussion{ //Useful Getters public function canAccess($membre){ - $out = $this->accessibility === 'p'; - $out = $out or $membre->getID() === $this->creator->getID(); + if($this->accessibility === 'p') + return TRUE; + if($membre->getID() === $this->creator->getID()) + return TRUE; if(preg_match ( "#^a[0-9]+$#", $this->accessibility ) == 1) - $out = $out or intval ( substr ( $this->accessibility, 1 ) ) <= $membre->getAdminLevel(); - $out = $out or preg_match ( '#^x([0-9]+;)*' . $membre->getID() . '(;[0-9]+)*$#', $disc ['autorized'] ) == 1; - $out = $out or $membre->getAdminLevel() >= 14; - return $out; + if(intval ( substr ( $this->accessibility, 1 ) ) <= $membre->getAdminLevel()) + return TRUE; + if(preg_match ( '#^x([0-9]+,)*' . $membre->getID() . '(,[0-9]+)*$#', $this->accessibility )) + return TRUE; + if($membre->getAdminLevel() >= 14) + return TRUE; + return FALSE; + } + + public function isPublic(){ + if($this->accessibility === 'p') + return TRUE; + return FALSE; } @@ -130,37 +141,43 @@ class Discussion{ public static function getFromName($name){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM discussions WHERE name=?'); $req->execute(array($name)); - return discussionGetterOutput($req); + return Discussion::discussionGetterOutput($req); } public static function getFromCreator($creator){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM discussions WHERE creatorID=?'); $req->execute(array($creator->getID())); - return discussionGetterOutput($req); + return Discussion::discussionGetterOutput($req); } public static function getFromDateCreation($date){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM discussions WHERE dateCreation=?'); $req->execute(array($date)); - return discussionGetterOutput($req); + return Discussion::discussionGetterOutput($req); } public static function getFromAccessibility($accessibility){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM discussions WHERE creatorID=?'); $req->execute(array($accessibility)); - return discussionGetterOutput($req); + return Discussion::discussionGetterOutput($req); } public static function getCreatedLaterThan($date){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM discussions WHERE dateCreation>?'); $req->execute(array($date)); - return discussionGetterOutput($req); + return Discussion::discussionGetterOutput($req); } public static function getCreatedEarlierThan($date){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM discussions WHERE dateCreationexecute(array($date)); - return discussionGetterOutput($req); + return Discussion::discussionGetterOutput($req); + } + + public static function getPublics(){ + $req = $GLOBALS['bdd']->prepare('SELECT * FROM discussions WHERE accessibility LIKE "p%"'); + $req->execute(); + return Discussion::discussionGetterOutput($req); } public static function getWhichHeCanAccess($he){ @@ -170,7 +187,7 @@ class Discussion{ $out = array(); while ( $rep = $req->fetch()) { $disc = new Discussion($rep['ID']); - if ($disc->canAccess($membre)) + if ($disc->canAccess($he)) $out[] = $disc; } if($out) @@ -178,6 +195,24 @@ class Discussion{ else return NULL; } + //Discussion creator + public static function createDiscussion($name, $owner) { + if(Discussion::getFromName($name)) + return Discussion::NAME_ALREADY_USED; + if(strlen($name)>255) + return Discussion::TOO_LONG_NAME; + $regex = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 éèàμ_\\-\'()\\[\\]\\\\/,;:.§!ù%£$¤=+\\-*\\#~"|ç@'; + $regex = '#^['.$regex.']+$#'; + if(preg_match($regex,$name) != 1) + return Discussion::ILLEGAL_NAME; + $req = $GLOBALS ['bdd']->prepare ("INSERT INTO `discussions`(`ID`, `name`, `creatorID`, `dateCreation`, `accessibility`) VALUES (NULL,?,?,NOW(),'p')" ); + $req->execute ( array ( + $name, + $owner + ) ); + return 'ok'; + } + // Exceptions texts @@ -196,4 +231,4 @@ class Discussion{ //setDateCreation() const MALFORMED_DATE = 'La date de création doit être de la forme "AAAA:MM:JJ hh:mm:ss"'; const DATE_CREATION_CHANGED = 'La date de création a bien été changée'; -} \ No newline at end of file +} diff --git a/clazz/Langage.class.php b/clazz/Langage.class.php index 82c1d6f..986d61c 100644 --- a/clazz/Langage.class.php +++ b/clazz/Langage.class.php @@ -5,7 +5,7 @@ class Langage{ public static $java; public static $vba; - protected static $languages = array(); + public static $languages = array(); protected $ID; protected $name; @@ -16,7 +16,7 @@ class Langage{ $this->ID = $ID; $this->name = $name; $this->avalivableFiles = explode(" ",$avalivableFiles); - $languages[] = $this; + Langage::$languages[] = $this; } public function getID(){ @@ -45,12 +45,20 @@ class Langage{ } public static function getFromID($ID){ - foreach(self::$languages AS $language){ + foreach(Langage::$languages AS $language){ if($language->getID() == $ID) return $language; } + //var_dump(Langage::$languages); return NULL; } + public static function getLanguagesFromVersions($versions){ + $languages = array(); + foreach($versions AS $version) + array_push($languages,$version->getLanguage()); + $languages = array_unique($languages,SORT_REGULAR); + return $languages; + } } Langage::$java = new Langage(0, "Java", "jar java javadoc"); diff --git a/clazz/MegaStockage.class.php b/clazz/MegaStockage.class.php new file mode 100644 index 0000000..ff41408 --- /dev/null +++ b/clazz/MegaStockage.class.php @@ -0,0 +1,327 @@ +ID = $ID; + $req = $GLOBALS['bdd']->prepare('SELECT * FROM megaStockages WHERE ID=?'); + $req->execute(array($ID)); + if($rep = $req->fetch()){ + $this->valid = TRUE; + $this->accountID = $rep['accountID']; + $this->accountPassword = $rep['accountPassword']; + $this->owner = new Membre($rep['owner']); + $this->liberties = /* TODO parse liberties */$rep['liberties']; + $this->path = $rep['path']; + $this->size = $rep['size']; + }else{ + $this->valid = FALSE; + } + } + + public function __toString(){ + $out = 'MegaStockage\n'; + $out .= '\tID:' . $this->ID . '\n'; + $out .= '\tAccount ID:' . $this->accountID . '\n'; + $out .= '\tAccount password' . $this->adminLevel . '\n'; + $out .= '\tOwner:' . $this->owner->__toString() . '\n'; + $out .= '\tLiberties:' . $this->liberties . '\n'; + $out .= '\tPath:' . $this->path . '\n'; + $out .= '\tSize:' . $this->size . '\n'; + return $out; + } + + public function exists(){ + return $this->valid; + } + + //Getters + //TODO gen getters + + //Useful getters + public function canRead($he){ + $read = $this->liberties[0]; + if($read=='public') + return TRUE; + else if(in_array($he->getID(),$read) + return TRUE; + return FALSE; + } + public function canWrite($he){ + $write = $this->liberties[1]; + if($write=='public') + return TRUE; + else if(in_array($he->getID(),$write) + return TRUE; + return FALSE; + } + + //Setters + public function setAttribute($attribute,$value,$valueType){ + //TODO todo + $json=FALSE; + switch ($attribute){ + case 'ID': + if($valueType !== '0'){ + echo 'Error : the type "'.$valueType.'" is not allowed for the attribute '.$attribute; + exit; + } + $value = intval($value); + break; + case 'pseudo': + if($valueType !== '"'){ + echo 'Error : the type "'.$valueType.'" is not allowed for the attribute '.$attribute; + exit; + } + $value = '"'.strval($value).'"'; + break; + case 'hashedPseudo': + if($valueType !== '"'){ + echo 'Error : the type "'.$valueType.'" is not allowed for the attribute '.$attribute; + exit; + } + $value = '"'.strval($value).'"'; + break; + case 'adminLevel': + if($valueType !== '0'){ + echo 'Error : the type "'.$valueType.'" is not allowed for the attribute '.$attribute; + exit; + } + $value = intval($value); + break; + case 'dateCreation': + if($valueType !== '"'){ + echo 'Error : the type "'.$valueType.'" is not allowed for the attribute '.$attribute; + exit; + } + $value = '"'.$value.'"'; + break; + case 'requiredBanner'://FIXME jsonMysqlProblem + $json=TRUE; + if($valueType !== '"'){ + echo 'Error : the type "'.$valueType.'" is not allowed for the attribute '.$attribute; + exit; + } + $value = '"'.strval($value).'"'; + break; + case 'personnalMessage': + $json=TRUE; + if($valueType !== '"'){ + echo 'Error : the type "'.$valueType.'" is not allowed for the attribute '.$attribute; + exit; + } + $value = '"'.strval($value).'"'; + break; + default: + echo 'Undefined attribute "'.$attribute.'" for the class Membre'; + exit; + } + + $restrictionValues[] = $value; + if($json){ + //TODO Set command for json + }else{ + $command = 'UPDATE membres SET ' . $attribute . '=' . $value . ' WHERE ID=' . $this->ID; + } + echo $command.'
'; + $req = $GLOBALS['bdd']->prepare($command); + $req->execute(array()); + if($req->errorInfo()[0] != 0){ + echo 'Eine MYSQL Exception hat geworft. Einschuldigung'; + exit; + } + } + + + /** + * + * @return Objects which matchs the specified restrictions + */ + public static function getFromAttributes($restrictions){ + $whereCommands = array(); + $restrictionValues = array(); + foreach ($restrictions as $restriction){ + $whereCommand = NULL; + $attribute = $restriction[0]; + $json = FALSE; + $operator = NULL; + $value = NULL; + try { + switch ($attribute){ + case 'ID': + if($restriction[2][0] !== '0'){ + echo 'Error : the type "'.$restriction[2][0].'" is not allowed for the attribute '.$attribute; + exit; + } + $value = intval($restriction[2][1]); + $operator = Utility::getIntegerSqlOperator($restriction[1]); + break; + case 'pseudo': + if($restriction[2][0] !== '"'){ + echo 'Error : the type "'.$restriction[2][0].'" is not allowed for the attribute '.$attribute; + exit; + } + $value = '"'.strval($restriction[2][1]).'"'; + $operator = Utility::getStringSqlOperator($restriction[1]); + break; + case 'hashedPseudo': + if($restriction[2][0] !== '"'){ + echo 'Error : the type "'.$restriction[2][0].'" is not allowed for the attribute '.$attribute; + exit; + } + $value = '"'.strval($restriction[2][1]).'"'; + $operator = Utility::getStringSqlOperator($restriction[1]); + break; + case 'adminLevel': + if($restriction[2][0] !== '0'){ + echo 'Error : the type "'.$restriction[2][0].'" is not allowed for the attribute '.$attribute; + exit; + } + $value = intval($restriction[2][1]); + $operator = Utility::getIntegerSqlOperator($restriction[1]); + break; + case 'dateCreation': + if($restriction[2][0] !== '"'){//TODO add type date + echo 'Error : the type "'.$restriction[2][0].'" is not allowed for the attribute '.$attribute; + exit; + } + $value = '"'.$restriction[2][1].'"'; + $operator = Utility::getDateSqlOperator($restriction[1]); + break; + case 'requiredBanner'://FIXME jsonMysqlProblem + $json=TRUE; + if($restriction[2][0] !== '"'){ + echo 'Error : the type "'.$restriction[2][0].'" is not allowed for the attribute '.$attribute; + exit; + } + $value = '"'.strval($restriction[2][1]).'"'; + $operator = Utility::getStringSqlOperator($restriction[1]); + break; + case 'personnalMessage': + $json=TRUE; + if($restriction[2][0] !== '"'){ + echo 'Error : the type "'.$restriction[2][0].'" is not allowed for the attribute '.$attribute; + exit; + } + $value = '"'.strval($restriction[2][1]).'"'; + $operator = Utility::getStringSqlOperator($restriction[1]); + break; + default: + echo 'Undefined attribute "'.$attribute.'" for the class Membre'; + exit; + } + }catch(InvalidOperatorException $e){ + echo $e->getMessage().' when reading attribute "'.$attribute.'"'; + exit; + } + + $restrictionValues[] = $value; + if($json){ + $whereCommand = '((data->"$.'.$attribute.'" IS NOT NULL) AND (data->"$.'.$attribute.'" '.$operator.' ? ))'; + }else{ + $whereCommand = $attribute . ' ' . $operator . ' ' . $value; + } + $whereCommands[] = $whereCommand; + } + $wherePart = ""; + if(count($whereCommands) >0) + $wherePart = 'WHERE '.implode(' AND ',$whereCommands); + + $command = 'SELECT * FROM membres '.$wherePart; + $req = $GLOBALS['bdd']->prepare($command); + $req->execute($restrictionValues); + echo $command.'
'; + if($req->errorInfo()[0] != 0) + echo 'Erreur SQL, veuillez verifier les selecteurs'; + $out = array(); + while($rep = $req->fetch()) + $out[] = new Membre($rep['ID']); + + //Choose return value + switch(count($out)){ + case 0: + return NULL; + case 1: + return $out[0]; + default: + return $out; + } + } + + public static function getFromPseudo($pseudo){ + return Membre::getFromAttributes(array(['pseudo','=',['"',$pseudo]])); + } + + public static function getFromAdminLevel($level){ + return Membre::getFromAttributes(array(['adminLevel','=',['0',$level]])); + } + + public static function getFromDateCreation($date){ + return Membre::getFromAttributes(array(['dateCreation','=',['0',$date]])); + } + + public static function getCreatedLaterThan($date){ + return Membre::getFromAttributes(array(['dateCreation','>',['"',$date]])); + } + + public static function getCreatedEarlierThan($date){ + return Membre::getFromAttributes(array(['dateCreation','<',['"',$date]])); + } + + public static function getAdminGreaterThan($min){ + return Membre::getFromAttributes(array(['adminLevel','>',['0',$min]])); + } + + public static function getAdminLowerThan($max){ + return Membre::getFromAttributes(array(['adminLevel','<',['0',$max]])); + } + + public static function me(){ + if(!isset($_SESSION['session_id'])) + return NULL; + $me = new Membre($_SESSION['session_id']); + if(!$me->exists()) + return NULL; + return $me; + } + + + //Membre creator + public static function registerPerson($pseudo, $mdp) { + if (Membre::getFromPseudo($pseudo)) + return Membre::USED_USERNAME; + $req = $GLOBALS ['bdd']->prepare ('INSERT INTO membres(pseudo,mdp,date_creation) VALUES (?,?,NOW())'); + $req->execute (array($pseudo,password_hash( $mdp, PASSWORD_DEFAULT))); + return Membre::PERSON_REGISTERED; + } + + //Operateurs + public function __is_identical($copain){ + return $this->getID() == $copain->getID(); + } + + + //Outputs texts + + //changePassword + const PASSWORD_TOO_LONG = 'Le mot de passe est trop long ! (Max : 255 caractères)'; + const PASSWORD_CHANGED = 'Le mot de passe a bien été changé'; + + //registerPerson + const USED_USERNAME = 'Le pseudonyme est déjà utilisé'; + const PERSON_REGISTERED = 'Le membre a bien été inscrit !'; +} + + + + + diff --git a/clazz/Membre.class.php b/clazz/Membre.class.php index 7fe28cf..ef5a295 100644 --- a/clazz/Membre.class.php +++ b/clazz/Membre.class.php @@ -44,7 +44,7 @@ class Membre { $out .= '\tDate of creation:' . $this->dateCreation . '\n'; $out .= '\tRequired banner:' . $this->requiredBanner . '\n'; $out .= '\tPersonnal message:' . $this->personnalMessage . '\n'; - return out; + return $out; } public function isConnected(){ @@ -95,7 +95,7 @@ class Membre { } public function isAdminLevelGreaterThan($min){ - return $this->adminLevel>$max; + return $this->adminLevel>$min; } public function isAdminLevelLowerOrEqualThan($max){ @@ -120,7 +120,7 @@ class Membre { public function changePassword($newPassword){ if(strlen($newPassword)>255) return Membre::PASSWORD_TOO_LONG; - $req = $GLOBALS['bdd']->prepare('UPDATE membres SET mdp=? WHERE ID=?'); + $req = $GLOBALS['bdd']->prepare('UPDATE membres SET hashedPassword=? WHERE ID=?'); $req->execute(array(password_hash ( $newPassword, PASSWORD_DEFAULT ),$this->ID)); return Membre::PASSWORD_CHANGED; } @@ -248,7 +248,7 @@ class Membre { $operator = Utility::getIntegerSqlOperator($restriction[1]); break; case 'dateCreation': - if($restriction[2][0] !== '"'){ + if($restriction[2][0] !== '"'){//TODO add type date echo 'Error : the type "'.$restriction[2][0].'" is not allowed for the attribute '.$attribute; exit; } @@ -316,31 +316,40 @@ class Membre { } public static function getFromPseudo($pseudo){ - return getFromAttributes(array(['pseudo','=',$pseudo])); + return Membre::getFromAttributes(array(['pseudo','=',['"',$pseudo]])); } public static function getFromAdminLevel($level){ - return getFromAttributes(array(['adminLevel','=',$level])); + return Membre::getFromAttributes(array(['adminLevel','=',['0',$level]])); } public static function getFromDateCreation($date){ - return getFromAttributes(array(['dateCreation','=',$date])); + return Membre::getFromAttributes(array(['dateCreation','=',['0',$date]])); } public static function getCreatedLaterThan($date){ - return getFromAttributes(array(['dateCreation','>',$date])); + return Membre::getFromAttributes(array(['dateCreation','>',['"',$date]])); } public static function getCreatedEarlierThan($date){ - return getFromAttributes(array(['dateCreation','<',$date])); + return Membre::getFromAttributes(array(['dateCreation','<',['"',$date]])); } public static function getAdminGreaterThan($min){ - return getFromAttributes(array(['adminLevel','>',$min])); + return Membre::getFromAttributes(array(['adminLevel','>',['0',$min]])); } public static function getAdminLowerThan($max){ - return getFromAttributes(array(['adminLevel','<',$max])); + return Membre::getFromAttributes(array(['adminLevel','<',['0',$max]])); + } + + public static function me(){ + if(!isset($_SESSION['session_id'])) + return NULL; + $me = new Membre($_SESSION['session_id']); + if(!$me->exists()) + return NULL; + return $me; } @@ -352,6 +361,11 @@ class Membre { $req->execute (array($pseudo,password_hash( $mdp, PASSWORD_DEFAULT))); return Membre::PERSON_REGISTERED; } + + //Operateurs + public function __is_identical($copain){ + return $this->getID() == $copain->getID(); + } //Outputs texts diff --git a/clazz/Message.class.php b/clazz/Message.class.php index 0d5bd95..366fd71 100644 --- a/clazz/Message.class.php +++ b/clazz/Message.class.php @@ -16,8 +16,8 @@ class Message{ if($rep = $req->fetch()){ $this->valid = TRUE; $this->sender = new Membre($rep['senderID']); - $this->sendDate = $rep['sendDate']; - $this->text = $rep['text']; + $this->sendDate = $rep['sendTime']; + $this->text = $rep['texte']; $this->discussion = new Discussion($rep['discussionID']); }else{ $this->valid = FALSE; @@ -78,7 +78,7 @@ class Message{ private static function messagesGetterOutput($req){ $out = array(); while($rep = $req->fetch()) - $out[] = new Discussion($rep['ID']); + $out[] = new Message($rep['ID']); switch(count($out)){ case 0: return NULL; @@ -92,45 +92,52 @@ class Message{ public static function getFromSender($param) { $req = $GLOBALS['bdd']->prepare('SELECT * FROM messages WHERE senderID=?'); $req->execute(array($sender->getID())); - return messagesGetterOutput($req); + return Message::messagesGetterOutput($req); } public static function getFromSendDate($date){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM messages WHERE sendDate=?'); $req->execute(array($date)); - return messagesGetterOutput($req); + return Message::messagesGetterOutput($req); } public static function getSendedLaterThan($date){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM messages WHERE sendDate>?'); $req->execute(array($date)); - return messagesGetterOutput($req); + return Message::messagesGetterOutput($req); } public static function getSendedEarlierThan($date){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM messages WHERE sendDateexecute(array($date)); - return messagesGetterOutput($req); + return Message::messagesGetterOutput($req); } public static function getFromText($text) { $req = $GLOBALS['bdd']->prepare('SELECT * FROM messages WHERE text=?'); $req->execute(array($text)); - return messagesGetterOutput($req); + return Message::messagesGetterOutput($req); } public static function getFromDiscussion($discut){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM messages WHERE discussionID=?'); $req->execute(array($discut->getID())); - return messagesGetterOutput($req); + return Message::messagesGetterOutput($req); } //Message creator public static function sendMessage($sender,$discussion,$text){ - $req = $GLOBALS ['bdd']->prepare ( 'INSERT INTO messages(discussion_id,texte,senderID,sendTime) VALUES (?,?,?,NOW())' ); + $req = $GLOBALS ['bdd']->prepare ( 'INSERT INTO messages(discussionID,texte,senderID,sendTime) VALUES (?,?,?,NOW())' ); $req->execute (array($discussion->getID(),htmlspecialchars ($text),$sender->getID())); } -} \ No newline at end of file + public function removeMessage(){ + $req = $GLOBALS ['bdd']->prepare ( 'DELETE FROM messages WHERE ID=?' ); + $req->execute (array($this->getID())); + } + + + +} diff --git a/clazz/Projet.class.php b/clazz/Projet.class.php index eb7e2d0..a387a0d 100644 --- a/clazz/Projet.class.php +++ b/clazz/Projet.class.php @@ -6,6 +6,7 @@ class Projet{ protected $dateCreation; protected $owner; protected $secondaryOwners; + protected $publik; protected $valid; @@ -19,8 +20,9 @@ class Projet{ $this->owner = new Membre($rep['ownerID']); $this->dateCreation = $rep['dateCreation']; $this->secondaryOwners = array(); - foreach (explode(';',$rep['secondaryOwners']) AS $secondaryOwner) + foreach (explode(';',$rep['secondaryOwnersID']) AS $secondaryOwner) $this->secondaryOwners[] = new Membre($secondaryOwner); + $this->publik = $rep['public']; }else{ $this->valid = FALSE; } @@ -38,7 +40,7 @@ class Projet{ foreach($this->secondaryOwners AS $secondaryOwner) $out .= '\tSecondary owner:{' . substr(str_replace('\n\t',';',$secondaryOwner->__toString()),0,-1) . '}\n'; $out .= '\tDate of creation:' . $this->dateCreation . '\n'; - return out; + return $out; } //Getters @@ -62,10 +64,14 @@ class Projet{ return $this->dateCreation; } + public function isPublic(){ + return $this->publik == 1; + } + //Useful getters public function haveRights($member){ - return $member->getID() == $owner->getID() or in_array($member,$this->secondaryOwners); + return $member->getID() == $this->owner->getID() or in_array($member,$this->secondaryOwners); } //Setters @@ -92,7 +98,7 @@ class Projet{ private static function projectGetterOutput($req){ $out = array(); while($rep = $req->fetch()) - $out[] = new Project($rep['ID']); + $out[] = new Projet($rep['ID']); switch(count($out)){ case 0: return NULL; @@ -104,19 +110,19 @@ class Projet{ } public static function getFromName($name){ - $req = $GLOBALS['bdd']->prepare('SELECT * FROM project WHERE name=?'); + $req = $GLOBALS['bdd']->prepare('SELECT * FROM projets WHERE name=?'); $req->execute(array($name)); return projectGetterOutput($req); } public static function getFromOwner($owner){ - $req = $GLOBALS['bdd']->prepare('SELECT * FROM project WHERE owner=?'); + $req = $GLOBALS['bdd']->prepare('SELECT * FROM projets WHERE owner=?'); $req->execute(array($owner->getID())); return projectGetterOutput($req); } public static function getFromSecondaryOwner($secondaryOwner){ - $req = $GLOBALS['bdd']->prepare('SELECT * FROM project'); + $req = $GLOBALS['bdd']->prepare('SELECT * FROM projets'); $req->execute(); $out = array(); while ($rep = $req->fetch()) { @@ -141,25 +147,44 @@ class Projet{ } public static function getCreatedLaterThan($date){ - $req = $GLOBALS['bdd']->prepare('SELECT * FROM project WHERE dateCreation>?'); + $req = $GLOBALS['bdd']->prepare('SELECT * FROM projets WHERE dateCreation>?'); $req->execute(array($date)); return projectGetterOutput($req); } public static function getCreatedEarlierThan($date){ - $req = $GLOBALS['bdd']->prepare('SELECT * FROM project WHERE dateCreationprepare('SELECT * FROM projets WHERE dateCreationexecute(array($date)); return projectGetterOutput($req); } public static function getWhichHeCanAccess($he){ //TODO Faire la selection directement grâce à une requette SQL - $req = $GLOBALS['bdd']->prepare('SELECT * FROM project'); + $req = $GLOBALS['bdd']->prepare('SELECT * FROM projets'); $req->execute(array()); $out = array(); while ( $rep = $req->fetch()) { $projet = new Projet($rep['ID']); - if ($projet->haveRights($membre)) + if ($projet->haveRights($he)) + $out[] = $projet; + } + switch(count($out)){ + case 0: + return NULL; + case 1: + return $out[0]; + default: + return $out; + } + } + + public static function getOthers($he){ + $req = $GLOBALS['bdd']->prepare('SELECT * FROM projets'); + $req->execute(array()); + $out = array(); + while ( $rep = $req->fetch()) { + $projet = new Projet($rep['ID']); + if ($he?$he->isAdminLevelGreaterThan(12):FALSE || $projet->isPublic()) $out[] = $projet; } switch(count($out)){ @@ -173,5 +198,4 @@ class Projet{ } - -} \ No newline at end of file +} diff --git a/clazz/Projet.php b/clazz/Projet.php deleted file mode 100644 index 0a9e3c7..0000000 --- a/clazz/Projet.php +++ /dev/null @@ -1,64 +0,0 @@ -ID = $ID; - $req = $GLOBALS['bdd']->prepare('SELECT * FROM projets WHERE ID=?'); - $req->execute(array($ID)); - if($rep = $req->fetch()){ - $this->valid = TRUE; - $this->name = $rep['name']; - $this->owner = new Membre($rep['ownerID']); - $this->dateCreation = $rep['dateCreation']; - $this->secondaryOwners = array(); - foreach (explode(';',$rep['secondaryOwners']) AS $secondaryOwner) - $this->secondaryOwners[] = new Membre($secondaryOwner); - }else{ - $this->valid = FALSE; - } - } - - public function exists(){ - return $this->valid; - } - - public function __toString(){ - $out = 'Projet\n'; - $out .= '\tID:' . $this->ID . '\n'; - $out .= '\tName:' . $this->name . '\n'; - $out .= '\tOwner:{' . substr(str_replace('\n\t',';',$this->owner->__toString()),0,-1) . '}\n'; - foreach($this->secondaryOwners AS $secondaryOwner) - $out .= '\tSecondary owner:{' . substr(str_replace('\n\t',';',$secondaryOwner->__toString()),0,-1) . '}\n'; - $out .= '\tDate of creation:' . $this->dateCreation . '\n'; - return out; - } - - //Getters - public function getID(){ - return $this->ID; - } - - public function getName(){ - return $this->name; - } - - public function getOwner(){ - return $this->owner; - } - - public function getSecondaryOwners(){ - return $this->secondaryOwners; - } - - public function getDateCreation(){ - return $this->dateCreation; - } - -} \ No newline at end of file diff --git a/clazz/Utility.class.php b/clazz/Utility.class.php index fe9e91d..87c1285 100644 --- a/clazz/Utility.class.php +++ b/clazz/Utility.class.php @@ -114,4 +114,10 @@ NOT REGEXP } } -} \ No newline at end of file + public static function arrayIfNot($var){ + if(!is_array($var)) + return array($var); + return $var; + } + +} diff --git a/clazz/Version.class.php b/clazz/Version.class.php index 44b5703..d9aab73 100644 --- a/clazz/Version.class.php +++ b/clazz/Version.class.php @@ -8,6 +8,7 @@ class Version{ protected $tags;//String "beta bugged" in bdd , stored as a string array protected $project; protected $language; + protected $versionAbs; public function __construct($ID){ $this->ID = $ID; @@ -15,12 +16,13 @@ class Version{ $req->execute(array($ID)); if($rep = $req->fetch()){ $this->valid = TRUE; - $this->name = $rem['name']; + $this->name = $rep['name']; $this->sendDate = $rep['sendDate']; $this->publicFiles = explode(" ",$rep['publicFiles']); $this->tags = explode(" ",$rep['tags']); - $this->project = new Project($rep['projectID']); - $this->language = Langage::getFromID($rep['languageID']); + $this->project = new Projet($rep['projectID']); + $this->language = Langage::getFromID(intval($rep['languageID'])); + $this->versionAbs = $rep['versionAbs']; }else{ $this->valid = FALSE; } @@ -31,15 +33,21 @@ class Version{ } public function __toString(){ - $out = 'Version\n'; - $out .= '\tID:' . $this->ID . '\n'; - $out .= '\tName:{' . $this->name . '}\n'; - $out .= '\tSend date:' . $this->sendDate . '\n'; - $out .= '\tPublic files:"' . implode(' ',$this->publicFiles) . '"}\n'; - $out .= '\tTags:"' . implode(' ',$this->tags) . '"}\n'; - $out .= '\tProject:' . substr(str_replace('\n\t',';',$this->project->__toString()),0,-1) . '\n'; - $out .= '\tLanguage:' . $this->language->getName() . '\n'; - return out; + try{ + $out = 'Version\n'; + $out .= '\tID:' . $this->ID . '\n'; + $out .= '\tName:{' . $this->name . '}\n'; + $out .= '\tSend date:' . $this->sendDate . '\n'; + $out .= '\tPublic files:"' . implode(' ',$this->publicFiles) . '"}\n'; + $out .= '\tTags:"' . implode(' ',$this->tags) . '"}\n'; + $out .= '\tProject:' . substr(str_replace('\n\t',';',$this->project->__toString()),0,-1) . '\n'; + $out .= '\tLanguage:' . $this->language->getName() . '\n'; + $out .= '\tVersion absolue:' . $this->versionAbs . '\n'; + return $out; + }catch(Error $e){ + echo '#' . $this->language . "#"; + return $e->__toString(); + } } @@ -74,6 +82,10 @@ class Version{ return $this->language; } + public function getVersionAbs(){ + return $this->versionAbs; + } + //Useful Getters //TODO make all of the following 'is' functions using haveTag public function haveTag($tag){ @@ -249,19 +261,25 @@ class Version{ public static function getFromLanguage($language){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM versions WHERE languageID=?'); $req->execute(array($language->getID())); - return versionGetterOutput($req); + return Version::versionGetterOutput($req); } public static function getFromProject($project){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM versions WHERE projectID=?'); $req->execute(array($project->getID())); - return versionGetterOutput($req); + return Version::versionGetterOutput($req); + } + + public static function getHighestFromProject($project){ + $req = $GLOBALS['bdd']->prepare('SELECT * FROM versions WHERE projectID=? and versionAbs=(SELECT MAX(versionAbs) FROM versions WHERE projectID=?)'); + $req->execute(array($project->getID(),$project->getID())); + return Version::versionGetterOutput($req); } public static function getFromName($name){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM versions WHERE name=?'); $req->execute(array($name)); - return versionGetterOutput($req); + return Version::versionGetterOutput($req); } public static function getFromTag($tag){ @@ -282,31 +300,28 @@ class Version{ return $out; } - return projectGetterOutput($req); - $req = $GLOBALS['bdd']->prepare('SELECT * FROM versions WHERE languageID=?'); - $req->execute(array($language->getID())); - return versionGetterOutput($req); + return Version::versionGetterOutput($req); } public static function getFromSendDate($date){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM versions WHERE sendDate=?'); $req->execute(array($date)); - return versionsGetterOutput($req); + return Version::versionGetterOutput($req); } public static function getSendedLaterThan($date){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM versions WHERE sendDate>?'); $req->execute(array($date)); - return versionsGetterOutput($req); + return Version::versionGetterOutput($req); } public static function getSendedEarlierThan($date){ $req = $GLOBALS['bdd']->prepare('SELECT * FROM versions WHERE sendDateexecute(array($date)); - return versionsGetterOutput($req); + return Version::versionGetterOutput($req); } -} \ No newline at end of file +} diff --git a/clazz/Zincluder.php b/clazz/Zincluder.php index 25b2ff3..9f164b8 100644 --- a/clazz/Zincluder.php +++ b/clazz/Zincluder.php @@ -1,12 +1,12 @@ getMessage()); } -//TODO all exceptions in functions must be returns (make handle too) //TODO in the classes , do more test of exists in setters include_once 'clazz/Utility.class.php'; include_once 'clazz/Langage.class.php'; @@ -14,5 +14,6 @@ include_once 'clazz/Membre.class.php'; include_once 'clazz/Discussion.class.php'; include_once 'clazz/Message.class.php'; include_once 'clazz/Projet.class.php'; +include_once 'clazz/Article.class.php'; //TODO Use class's consts for file names include_once 'clazz/Version.class.php'; diff --git a/creating_discussion.php b/creating_discussion.php deleted file mode 100644 index 7d13d24..0000000 --- a/creating_discussion.php +++ /dev/null @@ -1,16 +0,0 @@ - abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 éèàμ_-\'()[\\]\\\\/,;:.§!ù%£$¤=+-*\\#~"|ç@'; - echo $_POST['name']; header('Location:discuts.php'); - goto end; -} - -header('Location:discuts.php'); -end: \ No newline at end of file diff --git a/css/adminStyle.css b/css/adminStyle.css new file mode 100644 index 0000000..efec73f --- /dev/null +++ b/css/adminStyle.css @@ -0,0 +1,29 @@ +#adminDialogAnswer{ + border-top: 2px solid black; + display: block; + padding: 5px; +} +section.reponce{ + border: 1px solid black; +} +section.reponce > h3{ + margin-top: 5px; + margin-bottom: 8px; +} +section.reponce > samp{ + background-color: #111; + color: #0F0; +} +section.commander{ + border: 3px double black; + padding: 3px; +} +div.commander{ + padding: 2px; +} +section.commander > .commanderCommandSelector{ + border-bottom: 1px solid black; +} +.facultatif{ + border-bottom: 1px dotted silver; +} diff --git a/css/style.css b/css/style.css index d2bf8da..9000383 100644 --- a/css/style.css +++ b/css/style.css @@ -87,7 +87,7 @@ article{ } .articleText{ text-align: left; - margin: 25px 125px; + margin: 5%; } h1 { @@ -129,7 +129,7 @@ footer { #bande { display: block; - padding-bottom: 5px; + padding-bottom: 0px; margin-left: auto; margin-right: auto; } @@ -268,11 +268,26 @@ section.message div { text-align: right; } -/* Disposition with width */ -.nav2x2 { +samp#universe_text{ + text-align: justify; +} + + + +/* HEADER STYLE */ +.nav3x2 { display: none; } +#navLinks a { + display: inline-block; + width: 250px; + font-size: 3ex; + padding-left: 30px; + padding-right: 30px; + margin-top: 5px; +} + .navV { display: none; } @@ -295,21 +310,13 @@ section.message div { } } -@media screen and (max-width: 1180px) { /* Afficher nav2x2 */ - .nav2x2 { +@media screen and (max-width: 1180px) { /* Afficher nav3x2 */ + .nav2x3 { display: inline; } - #navLinks a { - display: inline-block; - width: 250px; - font-size: 3ex; - padding-left: 30px; - padding-right: 30px; - margin-top: 5px; - } } -@media screen and (max-width: 615px) { /* Afficher navV */ +@media screen and (max-width: 400px) { /* Afficher navV */ .navV { display: inline; } @@ -317,7 +324,5 @@ section.message div { display: inline-block; width: 200px; font-size: 2ex; - padding-left: 30px; - padding-right: 30px; } -} \ No newline at end of file +} diff --git a/deletingMessage.php b/deletingMessage.php deleted file mode 100644 index d8a148b..0000000 --- a/deletingMessage.php +++ /dev/null @@ -1,20 +0,0 @@ - + + + + - + + + -
+ = 14)) { - - header ( 'Location:403.php' ); - - goto end; - } else if (! discutExists ()) { - - header ( 'Location:40A.php' ); - - goto end; - } - - else if (isConnected ()) { - - ?> -
- + //TODO re la fonction exiting + $me = Membre::me(); + if(!isset($_GET['d'])){ + header ( 'Location:discuts.php'); + $_SESSION ['current_error'] = 'Quand on demande des données, on donne des données !!!'; + exit; + } + $discut = new Discussion($_GET['d']); + if(!$discut->exists()){ + header ( 'Location:discuts.php'); + $_SESSION ['current_error'] = 'Je vais avoir du mal à afficher les donées de la version néant ...'; + exit; + } + if($me?!$discut->canAccess($me):!$discut->isPublic()){ + header ( 'Location:discuts.php'); + $_SESSION ['current_error'] = 'Vous n\'avez pas le droit d\'être ici ...
DEGAGEZ !!!'; + exit; + } + if ($me) {?> +
+ + +
+ +
Vous devez vous connecter pour envoyer des messages !
-
+ + + -
+ + +
@@ -127,4 +146,6 @@ include_once 'includes/inter.php';
- \ No newline at end of file + + + diff --git a/discuts.php b/discuts.php index b6f3cc6..ede700c 100644 --- a/discuts.php +++ b/discuts.php @@ -1,44 +1,48 @@ +include_once 'clazz/Zincluder.php';?> + + + - + + + +
+ + getID() . '">' . $disc->getName() . ' par ' . $disc->getCreator()->getPseudo() . '
'; + } + ?> + +
+ + + + isAdminLevelGreaterThan(8):FALSE){?> + Creer une nouvelle discussion + + + + + + +
- - = 14) { - - echo '' . $disc ['name'] . ' par ' . getPseudoOf ( $disc ['creator_id'] ) . '
'; - } - } - - ?> -
- =2){?> - Creer une nouvelle discussion


- + + - \ No newline at end of file + + diff --git a/editVersion.php b/editVersion.php index 4ae37b1..b12ae59 100644 --- a/editVersion.php +++ b/editVersion.php @@ -9,16 +9,6 @@ include_once 'includes/inter.php'; -


@@ -42,5 +32,3 @@ include_once 'includes/inter.php'; - \ No newline at end of file diff --git a/executor.php b/executor.php index c5a3175..a3ea4e0 100644 --- a/executor.php +++ b/executor.php @@ -1,43 +1,182 @@ should return on $_SESSION ['current_error'] (0) or via echo (1) +*/ -if (! isset ( $_GET ['action'] )) { - header ( 'Location:40A.php' ); - exit(); +function exiting($message,$location='register.php'){ + header ( 'Location:' . $location ); + $_SESSION ['current_error'] = $message; + exit; } + + +if (! isset ( $_GET ['action'] )) + exiting(NULL,'40A.php'); + + switch ($_GET ['action']) { case 'register' : - if (isset ( $_POST ['pseudo'] ) && isset ( $_POST ['mdp'] ) && isset ( $_POST ['mdp2'] )) { - if ($_POST ['mdp'] === $_POST ['mdp2']) { - if (preg_match ( "#^[a-zA-Z0-9\\-_]+$#", $_POST ['pseudo'] )) { - if (preg_match ( "#^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\\-_&éèàùçµ\"\\#'{}()[\\]|\\^@°+=\$¤£*!§:/;.,?²]+$#", $_POST ['mdp'] )) { - - switch (Membre::registerPerson ()) { - case 'ok' : - $_SESSION ['current_error'] = 'Vous avez déjà été correctement inscrit sur bernard.com'; - header('Location:login.php'); - exit(); - case 'usedPseudo' : - $_SESSION ['current_error'] = 'Le pseudonyme est déjà utilisé (par une entité differente de vous)'; - break; - } - } else { - $_SESSION ['current_error'] = 'Le mot de passe fut incorrect : Les seuls caractères autorisés sont :
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_&éèàùçµ"#\'{}()[]|^@°+=$¤£*!§:/;.,?²'; - } - } else { - - $_SESSION ['current_error'] = 'Le pseudo sera incorrect : Les seuls caractères autorisés sont :
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_'; - } - } else { - - $_SESSION ['current_error'] = 'Tu auras du rentrer deux fois le même mot de passe (tu permet aussi de rendre le champs "Recopier le mot de passe" utile)'; - } - } else { - - $_SESSION ['current_error'] = 'Quand on demande des données , on donne des données !!!'; + //Action : register + if (!(isset ( $_POST ['pseudo'] ) && isset ( $_POST ['mdp'] ) && isset ( $_POST ['mdp2'] ))) + exiting('Quand on demande des données, on donne des données !!!'); + if ($_POST ['mdp'] === $_POST ['mdp2']) + exiting('Tu auras du rentrer deux fois le même mot de passe (tu permet aussi de rendre le champs "Recopier le mot de passe" utile)'); + if (preg_match ( "#^[a-zA-Z0-9\\-_]+$#", $_POST ['pseudo'] )) + exiting('Le pseudo sera incorrect : Les seuls caractères autorisés sont :
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_'); + if (preg_match ( "#^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\\-_&éèàùçµ\"\\#'{}()[\\]|\\^@°+=\$¤£*!§:/;.,?²]+$#", $_POST ['mdp'] )) + exiting('Le mot de passe fut incorrect : Les seuls caractères autorisés sont :
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_&éèàùçμ"#\'{}()[]|^@°+=$¤£*!§:/;.,?²'); + + $out = Membre::registerPerson ($_POST ['pseudo'],$_POST ['mdp']); + if($out ===Membre::USED_USERNAME) + exiting('Le pseudonyme est déjà utilisé (par une entité differente de vous)'); + exiting('Vous avez déjà été correctement inscrit sur bernard.com','login.php'); + + case 'login' : + //Action : login + if (!( isset ( $_POST ['pseudo'] ) && isset ( $_POST ['mdp'] ) )) + exiting('Quand on demande des données, on donne des données !!!'); + $me = Membre::getFromPseudo($_POST['pseudo']); + if(!$me) + exiting('Kikètvou ? Pseudo inconnu ...'); + if(!$me->connect($_POST ['mdp'])) + exiting('Votre empreinte rétinale, digital et génetique ne correspond pas à celles stoquées dans notre base de données (Technologie à venir)'); + $_SESSION['session_id'] = $me->getID(); + $_SESSION['session_mdp'] = $_POST['mdp']; + exiting('Vous êtes bien connecté (vous l\'avez été et le serez également)!'); + + case 'changePassword' : + //Action : change password + if(!(isset($_POST['rmdp']) && isset($_POST['nmdp']) && isset($_POST['nmdp2']))) + exiting('Quand on demande des données, on donne des données !!!'); + if(!$me) + exiting('Si tu ne te connectes pas, comment veut tu que je sache quel mot de passe changer !'); + if(!$me->connect($_POST['rmdp'])) + exiting('Votre empreinte rétinale, digital et génetique ne correspond pas à celles stoquées dans notre base de données (Technologie à venir)'); + if($_POST['nmdp'] !== $_POST['nmdp2']) + exiting('Tu auras du rentrer deux fois le même mot de passe (tu permet aussi de rendre le champs "Recopier le mot de passe" utile)'); + $out = $me->changePassword($_POST['nmdp']); + if($out == Membre::PASSWORD_TOO_LONG) + exiting('Mot de passe ≠ roman (255 caractères maximum)'); + exiting('Vos dispositifs d\'identification ont été correctement changés'); + + case 'createDiscussion' : + //Action : create discussion + if(!isset($_POST['name'])) + exiting('Quand on demande des données, on donne des données !!!'); + if(!$me) + exiting('Veuillez vous identifier pour acceder à cette section !!!'); + if(!$me->connect($_SESSION['session_mdp'])) + exiting('Votre empreinte rétinale, digital et génetique ne correspond pas à celles stoquées dans notre base de données (Technologie à venir)'); + if($me->isAdminLevelLowerThan(2)) + exiting('Vous n\'êtes pas assez PUISSANT !!!!!!!!!! (Faut un adminLevel de 2 ou plus)'); + + $out = Discussion::createDiscussion($_POST ['name'],$_SESSION ['session_id']); + if($out === Discussion::NAME_ALREADY_USED) + exiting('Mince j\'ai déjà utilisé l\'écriteau avec ce nom ... t\'en as pas un autre ?'); + if($out === Discussion::ILLEGAL_NAME) + exiting('Y a des trucs qui ne me plaisent pas dans le nom que tu as donné à ta discussion ...
Je n\'accepte que les caractères abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789éèàμ_-\'()[\\]\\\\/,;:.§!ù%£$¤=+-*\\#~"|ç@'); + if($out === Discussion::TOO_LONG_NAME) + exiting('Nom de discussion ≠ roman (255 caractères maximum)'); + exiting('C\'est fait !!! (la création de ta discussion bien sûr)'); + + case 'postMessage' : + //Action : post message + if(!$me) + exiting('Veuillez vous identifier pour acceder à cette section !!!'); + if(!$me->connect($_SESSION['session_mdp'])) + exiting($me.'Votre empreinte rétinale, digital et génetique ne correspond pas à celles stoquées dans notre base de données (Technologie à venir)'); + $discussion = new Discussion($_GET ['d']); + if(!$discussion->exists()) + exiting('Pour des raisons d\'intégrité du site, nous avons décidé de ne pas autoriser les messages dans les discussions inexistantes (pour les superadmins, c\'est possible en forcant la bdd &128516; )'); + if(!$discussion->canAccess($me)) + exiting('Tu pensais que tu pouvais écrire des messages dans une discussion à laquelle tu n\'as pas accès !!! Tu te crois où ?'); + Message::sendMessage($me,$discussion,$_POST ['msg']); + exiting(NULL,'discut.php?d='.$discussion->getID()); + case 'deleteMessage' : + //Action : delete message + if(!isset($_GET ['m'])) + exiting('c'); + if(!$me) + exiting('Veuillez vous identifier pour supprimer un message !!!'); + if(!$me->connect($_SESSION['session_mdp'])) + exiting('Votre empreinte rétinale, digital et génetique ne correspond pas à celles stoquées dans notre base de données (Technologie à venir)'); + $message = new Message($_GET['m']); + if(!$message->exists()) + exiting('Je vais avoir du mal à supprimer le message n&ecute;ant ...'); + if($me->isAdminLevelLowerThan(6) && $me->getID() !== $message->getSender()->getID()) + exiting('Vous n\'êtes pas assez PUISSANT !!!!!!!!!! (Faut un adminLevel de 6 ou plus OU etre l\'auteur de ce message'); + $message->removeMessage(); + exiting(NULL,'discut.php?d='.$message->getDiscussion()->getID()); + case 'editVersion' : + //Action : edit version + if(!isset($_GET ['v'])) + exiting('Quand on demande des données, on donne des données !!!'); + if(!$me) + exiting('Veuillez vous identifier pour éditer une version !!!'); + if(!$me->connect($_SESSION['session_mdp'])) + exiting('Votre empreinte rétinale, digital et génetique ne correspond pas à celles stoquées dans notre base de données (Technologie à venir)'); + $version = new Version($_GET['v']); + if(!$version->exists()) + exiting('Je vais avoir du mal à éditer la version n&ecute;ant ...'); + if($me->isAdminLevelLowerThan(13) && $version->getProject()->haveRights($me)) + exiting('Vous n\'êtes pas assez PUISSANT !!!!!!!!!! (Faut un adminLevel de 6 ou plus OU etre un des pocesseurs du projet'); + //TODO concretly modify the version, with all the options (remove included) + exit; + case 'getDiscutsMessages' : + //Action : get discut's messages + //TODO precise output type (via $_GET) + $query = 'SELECT m.ID AS messageID,u.ID AS senderID, u.pseudo AS pseudo, m.texte AS texte, m.sendTime AS sendTime, UNIX_TIMESTAMP(m.sendTime) AS sendTimestamp FROM users AS u INNER JOIN messages AS m ON u.ID = m.senderID WHERE m.discussion_id=?'; + + $data = array (); + if(!isset($_GET ['d'])){ + echo 'ERROR : NO DISCUSSION PROVIDED'; + exit; + } + if($me?!$me->connect($_SESSION['session_mdp']):FALSE){ + echo 'Votre empreinte rétinale, digital et génetique ne correspond pas à celles stoquées dans notre base de données (Technologie à venir)'; + exit; + } + $discut = new Discussion($_GET ['d']); + if(!$discut->exists()){ + echo 'Quand on demande des données, on donne des données !!!'; + exit; + } + $messages = Utility::arrayIfNot(Message::getFromDiscussion($discut)); + $jmsgs = array(); + foreach($messages as $message){ + $jmsg = array(); + $jmsg['messageID'] = $message->getID(); + $jmsg['senderID'] = $message->getSender()->getID(); + $jmsg['pseudo'] = $message->getSender()->getPseudo(); + $jmsg['texte'] = $message->getText(); + $jmsg['sendTime'] = $message->getSendDate(); + $jmsg['sendTimestamp'] = strToTime($message->getSendDate()); + $jmsg['rights'] = ($me)? $message->getSender()->getID() == $me->getID() || $me->isAdminLevelGreaterThan(5):FALSE; + array_push($jmsgs,$jmsg); } - header ( 'Location:register.php' ); + echo json_encode ( $jmsgs ); + flush (); + exit; + + + + + + + + + + + + + + + + + + } diff --git a/base.php b/extras/base.php similarity index 100% rename from base.php rename to extras/base.php diff --git a/downloadJar.php b/extras/downloadJar.php similarity index 100% rename from downloadJar.php rename to extras/downloadJar.php diff --git a/inter.php b/extras/inter.php similarity index 100% rename from inter.php rename to extras/inter.php diff --git a/mandelbrot.html b/extras/mandelbrot.html similarity index 100% rename from mandelbrot.html rename to extras/mandelbrot.html diff --git a/extras/quizz.yml b/extras/quizz.yml new file mode 100644 index 0000000..d4a066e --- /dev/null +++ b/extras/quizz.yml @@ -0,0 +1,19 @@ +!!com.bernard.qcminator.quiz.DEVerbenQuiz +author: Mysaa +entryCount: 2 +name: Schwach verben +verben: +- aux: 0 + infinitiv: [gehen, gaiheun, gaien, geheun] + partizipPerfekt: [gegangen, gegehen, gegeht, gegehet] + prasens2: [gehst, gaist] + prasens3: [geht, gaitte, gait, gétteu, gäht] + prateritum2: [ginget, gingueut] + prateritum3: [ging, gung, gang, gèng] +- aux: 1 + infinitiv: [schwimmen, chvimeun, schwimen, schvimmen] + partizipPerfekt: [geschwommen, geschwomen, schwomen, schwommen] + prasens2: [schwimmst, schwimst] + prasens3: [schwimmt, schwimt] + prateritum2: [schwammst, schwamst] + prateritum3: [schwamm, schwamt, schwam, schwammte] diff --git a/sortBDD.php b/extras/sortBDD.php similarity index 100% rename from sortBDD.php rename to extras/sortBDD.php diff --git a/form.php b/form.php deleted file mode 100644 index 85f39ec..0000000 --- a/form.php +++ /dev/null @@ -1,9 +0,0 @@ - - - - - -
-
- - \ No newline at end of file diff --git a/getDiscutsMessages.php b/getDiscutsMessages.php deleted file mode 100644 index 798f034..0000000 --- a/getDiscutsMessages.php +++ /dev/null @@ -1,27 +0,0 @@ -prepare ( $query ); -$req->execute ( array ( - $_GET ['d'] -) ); -while ( $donnees = $req->fetch () ) { - $donnees['rights'] = $donnees['senderID'] == $pseudoID || $adminLevel>=6; - array_push ( $data, $donnees ); - $bool = true; -} - -$req->closeCursor (); -echo json_encode ( $data ); - -flush (); \ No newline at end of file diff --git a/includes/MathJax b/includes/MathJax new file mode 160000 index 0000000..be11806 --- /dev/null +++ b/includes/MathJax @@ -0,0 +1 @@ +Subproject commit be11806df1ae075508e33500c990497062ef3c5a diff --git a/includes/bdd.php b/includes/bdd.php index 4298a9f..7c46d56 100644 --- a/includes/bdd.php +++ b/includes/bdd.php @@ -1,8 +1,8 @@ getMessage()); + die ('Erreur : ' . $e->getMessage() . "\n"); } -?> \ No newline at end of file +?> diff --git a/includes/footer.php b/includes/footer.php index fcfbd64..7510427 100644 --- a/includes/footer.php +++ b/includes/footer.php @@ -10,14 +10,19 @@ Haut de page + +
-
+
+
+
+ - + + \ No newline at end of file + headBloc.appendChild( link ); + + //Load server jQuery if not loaded + var jQuerySrc = 'https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML' + var mathJaxSrc = 'http://code.jquery.com/jquery-latest.min.js' + if(!navigator.onLine){ + jQuerySrc = 'includes/jquery-latest.min.js'; + mathJaxSrc = "includes/MathJax/MathJax.js?config=TeX-AMS_CHTML"; + } + var script = document.createElement("script"); + script.type = "text/javascript"; + script.src = jQuerySrc; + headBloc.appendChild(script); + script = document.createElement("script"); + script.type = "text/javascript"; + script.src = mathJaxSrc; + headBloc.appendChild(script); + + diff --git a/index.php b/index.php index d8223c2..6fe984b 100644 --- a/index.php +++ b/index.php @@ -11,128 +11,17 @@

J'ai le plaisir de vous souhaiter la bienvenue au sein de notre site: bernard.890m.com

-
-

Cercloïde

- - -
- $$C: \sum_{n=1}^N{\sqrt[p]{\sum_{g=1}^G{\left|F_{g,n}-A_n\right|^p}}}=r$$ - -
    -
  • \(p \in \mathbb{R}^*\) : l'exposant qui détermine la norme utilisé
  • -
  • \(N \in \mathbb{N}^*\) : le nombre de dimension de l'espace
  • -
  • \(G \in \mathbb{N}^*\) : le nombre de foyer
  • -
  • \(r \in \mathbb{R}_+\) : le rayon
  • -
  • \(A \in \mathbb{R}^N\) : le point considéré
  • -
  • \(F \in (\mathbb{R}^N)^G\) : le tableau de foyer
  • -
-
-
+ +
+ +

getTitle(); ?>

+ getPicPath() != ''){?> -
-

Zeidhyx Project

- - -
-

- Eclipse Neon download: Win64|32.
- Téléchargement du workspace Eclipse ici : -

- - -
-
+
getShort() == '')?$article->getText():$article->getShort(); ?>
+
+ -
-

Courbe de Bézier

- - -
-
    -
  • \(N \in \mathbb{N}^*\) : nombre de point nécessaire pour décrire la courbe.
  • -
  • \(p \in \mathbb{R}^N\) : tableau de points ordonnés décrivant la courbe (indices allant de 0 à N-1).
  • -
  • \(t \in [0;1]\) : paramètre de l'équation paramétrique.
  • -
  • \(n\) et \(m \in \mathbb{N}\) : variables itératives des sommations.
  • -

- - $$bézier(t, P) = \frac{\displaystyle\sum_{n=0}^{N-1}{\frac{t^{N-n-1} n! \displaystyle\sum_{m=0}^{N-1}{\frac{(-1)^{m-n-1}m!p_{N-m-1}}{(N-m-1)!(N-2m-1)!}}}{(N-n-1)!}}}{(N-1)!}$$ - -
    -
  • Avec 1 point, la courbe est ce point.
  • -
  • Avec 2 points, la courbe est un fragment de droite, le segment reliant ces deux points.
  • -
  • Avec N points, la courbe est un fragment de courbe de degré N-1, commançant au point 0 et se terminant au point N-1.
  • -
- -
Geogebra tester in works : download (version 201603121831)
- - Pour ceux qui préfèrent, voici un petit algorithme récursif fonctionnant normalement pour 2 dimensions.
- -
- public static Point recursiveBezier(double t,Point... p){
-   Point[] out = new Point[points.length-1];
-   for(int i = 1; i < p.length; i++)
-     out[i-1] = p[i-1].set(p[i-1].x + t*(p[i].x-p[i-1].x), p[i-1].y + t*(p[i].y-p[i-1].y));
-   return (out.lenght == 1) ? out[0] : recursiveBezier(t, out);
- }
-
- - - -
-
- - - - - -
-

Administration

- -
-
    -
  1. Coming soon (or not)
  2. -
  3. Possibilité de créer des discussions
  4. -
  5. Coming soon (or not)
  6. -
  7. Coming soon (or not)
  8. -
  9. Coming soon (or not)
  10. -
  11. Possibilité d'editer ou de supprimer n'importe quel message
  12. -
  13. Coming soon (or not)
  14. -
  15. Coming soon (or not)
  16. -
  17. Coming soon (or not)
  18. -
  19. Coming soon (or not)
  20. -
  21. Coming soon (or not)
  22. -
  23. Accès en téléchargement des fichiers des projets même privés
  24. -
  25. Coming soon (or not)
  26. -
  27. Accèder à toutes les discussions (même privées)
  28. -
  29. Accès à la passée console d'administration
  30. -
-
-
- -
-

Formules en vrac

- -
-
    -
  • \(e^{i\pi} + 1 = 0\)
  • -
  • \(\pi = \frac{9801}{2\sqrt{2} \displaystyle\sum^{+\infty}_{n=0} \frac{(4n)!}{(n!)^4} \times \frac{[1103 + 26390n]}{(4 \times 99)^{4n}}} = 6\displaystyle\sum^{+\infty}_{n=1}{\frac{1}{n^2}}\)
  • -
  • \(\begin{pmatrix} 1 & 0 & 0 \\ 0 & \cos \alpha & -\sin \alpha \\ 0 & \sin \alpha & \cos \alpha \\ \end{pmatrix} \begin{pmatrix} \cos \beta & 0 & \sin \beta \\ 0 & 1 & 0 \\ -\sin \beta & 0 & \cos \beta \\ \end{pmatrix} \begin{pmatrix} \cos \gamma & -\sin \gamma & 0 \\ \sin \gamma & \cos \gamma & 0 \\ 0 & 0 & 1 \\ \end{pmatrix}\), la matrice de rotation dans \(\mathbb{R}^3\) d'angle \(\alpha\) autour de l'axe x, \(\beta\) autour de y et \(\gamma\) autour de z.
  • -
-
-
- \ No newline at end of file + diff --git a/logging.php b/logging.php deleted file mode 100644 index c9a6930..0000000 --- a/logging.php +++ /dev/null @@ -1,25 +0,0 @@ - +

@@ -30,4 +30,4 @@ } ?> - \ No newline at end of file + diff --git a/others.php b/others.php index 083e5a1..20de319 100644 --- a/others.php +++ b/others.php @@ -1,7 +1,8 @@ - + + - @@ -12,15 +13,19 @@

Tous les projets

getID() .'">Le projet ' . $project->getName() . ' en version ' . $version->getName() . '
'); + else + echo ('Le projet ' . $project->getName() . ' sans version
'); + } - $projects = getProjectsWithFirstPermission(); - - foreach($projects as $project){ - echo ('Le projet ' . $project['projectName'] . ' en version ' . $project['versionName'] . '
'); - } - ?>
+ ?> +
- \ No newline at end of file + diff --git a/posting_message.php b/posting_message.php deleted file mode 100644 index 489bbbb..0000000 --- a/posting_message.php +++ /dev/null @@ -1,16 +0,0 @@ -=14){ - header('Location:401.php'); - goto end; -} - -sendMessage(); - -header('Location:discut.php?d='.$_GET['d']); -end: \ No newline at end of file diff --git a/profile.php b/profile.php index 63f62d5..f70f582 100644 --- a/profile.php +++ b/profile.php @@ -1,4 +1,5 @@ - + @@ -7,33 +8,29 @@ - - - Changer le mot de passe :
- - -
- - -
- - -
- -
- + + +
+ Changer le mot de passe :
+ + +
+ + +
+ + +
+ +
+ - \ No newline at end of file + diff --git a/projet.php b/projet.php index 42e1e37..16d509a 100644 --- a/projet.php +++ b/projet.php @@ -1,120 +1,103 @@ - - + + + - - - + + + - - - + + - -

Le projet en version

-
- - 12){ echo( '"megaProcess/downloadJar.php?id='. $data[ 'pID'] . '&v='. $data[ 'versionAbs'] . '"');}else{ echo( "\"#\"");} ?>> - " alt="Télécharger le jar" title="Télécharger le jar" src="pictures/download_jar.png"/> - - 12){ echo( '"megaProcess/viewJavaSrc.php?id='. $data[ 'pID'] . '&v='. $data[ 'versionAbs'] . '"');}else{ echo( "\"#\"");} ?>> - " alt="Voir la source" title="Voir la source" src="pictures/view_code.png"/> - - 12){ echo( '"megaProcess/downloadJavaSrc.php?id='. $data[ 'pID'] . '&v='. $data[ 'versionAbs'] . '"');}else{ echo( "\"#\"");} ?>> - " alt="Télécharger la source" title="Télécharger la source" src="pictures/download_code.png"/> - - 12){ echo( '"megaProcess/viewJavadoc.php?id='. $data[ 'pID'] . '&v='. $data[ 'versionAbs'] . '"');}else{ echo( "\"#\"");} ?>> - " alt="Voir la doc" title="Voir la doc" src="pictures/view_javadoc.png"/> - - 12){ echo( '"megaProcess/downloadJavadoc.php?id='. $data[ 'pID'] . '&v='. $data[ 'versionAbs'] . '"');}else{ echo( "\"#\"");} ?>> - " alt="Télecharger la doc" title="Télecharger la doc" src="pictures/download_javadoc.png"/> - - -
- - 12){ echo( '"megaProcess/downloadXlsm.php?id='. $data[ 'pID'] . '&v='. $data[ 'versionAbs'] . '"');}else{ echo( "\"#\"");} ?>> - " alt="Télécharger le xlsm" title="Télécharger le xlsm" src="pictures/download_xlsm.png"/> - - 12){ echo( '"megaProcess/viewVbSrc.php?id='. $data[ 'pID'] . '&v='. $data[ 'versionAbs'] . '"');}else{ echo( "\"#\"");} ?>> - " alt="Voir la source" title="Voir la source" src="pictures/voir_vb.png"/> - - 12){ echo( '"megaProcess/downloadVbSrc.php?id='. $data[ 'pID'] . '&v='. $data[ 'versionAbs'] . '"');}else{ echo( "\"#\"");} ?>> - " alt="Télécharger la source" title="Télécharger la source" src="pictures/download_vb.png"/> - - - -
-
-

Toutes les versions :

-
- - 0){?> - - - - - - - -
Java
- - - 0){?> - - - - - - - -
VBA
- - -
-
- - Nouvelle version
- Modifier la version
- Supprimer la version
- Modifier le projet
- Supprimer le projet
- - - - - exists()){ + header ( 'Location:projets.php'); + $_SESSION ['current_error'] = 'Je vais avoir du mal à afficher les donées de la version néant ...'; + exit; + } + if(count($version->getPublicFiles())<=0 && $me?$me->isAdminLevelLowerThan(12):FALSE && !$version->getProject()->haveRights()){ + header ( 'Location:projets.php'); + $_SESSION ['current_error'] = 'Vous n\'avez pas le droit d\'être ici ...
DEGAGEZ !!!'; + exit; + } + $su = $me?$version->getProject()->haveRights($me):FALSE OR $me?$me->isAdminLevelHigherThan(12):FALSE; ?> - - +

Le projet getProject()->getName()) ?> en version getName()) ?>

+
+ getLanguage()->isJarAvalivable()){?> + isJarPublic() OR $su){ echo( '"megaProcess/downloadJar.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>> + " alt="Télécharger le jar" title="Télécharger le jar" src="pictures/download_jar.png"/> + + getLanguage()->isJavaAvalivable()){ ?> + isJavaPublic() OR $su){ echo( '"megaProcess/viewJavaSrc.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>> + " alt="Voir la source" title="Voir la source" src="pictures/view_code.png"/> + + getLanguage()->isJavaAvalivable()){ ?> + isJavaPublic() OR $su){ echo( '"megaProcess/downloadJavaSrc.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>> + " alt="Télécharger la source" title="Télécharger la source" src="pictures/download_code.png"/> + + getLanguage()->isJavadocAvalivable()){ ?> + isJavadocPublic() OR $su){ echo( '"megaProcess/viewJavadoc.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>> + " alt="Voir la doc" title="Voir la doc" src="pictures/view_javadoc.png"/> + + getLanguage()->isJavadocAvalivable()){ ?> + isJavadocPublic() OR $su){ echo( '"megaProcess/downloadJavadoc.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>> + " alt="Télecharger la doc" title="Télecharger la doc" src="pictures/download_javadoc.png"/> + + getLanguage()->isXlsmAvalivable()){ ?> + isXlsmPublic() OR $su){ echo( '"megaProcess/downloadXlsm.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>> + " alt="Télécharger le xlsm" title="Télécharger le xlsm" src="pictures/download_xlsm.png"/> + + getLanguage()->isVbAvalivable()){ ?> + isVbPublic() OR $su){ echo( '"megaProcess/viewVbSrc.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>> + " alt="Voir la source" title="Voir la source" src="pictures/voir_vb.png"/> + + getLanguage()->isVbAvalivable()){ ?> + isVbPublic() OR $su){ echo( '"megaProcess/downloadVbSrc.php?v='.$version->getID() . '"');}else{ echo( "\"#\"");} ?>> + " alt="Télécharger la source" title="Télécharger la source" src="pictures/download_vb.png"/> + + - \ No newline at end of file +
+
+ getProject()); ?> + 1) */ ?> + +

Toutes les versions :

+
+ + + + + + getLanguage() == $language){ ?> + + +
getName(); ?>
getName(); ?>
+ + +
+
+ + getProject()->haveRights($me):FALSE){ ?> + Nouvelle version
+ Modifier la version
+ Supprimer la version
+ Modifier le projet
+ Supprimer le projet
+ +
+ + + + + + diff --git a/projets.php b/projets.php index 5e28688..2e68f95 100644 --- a/projets.php +++ b/projets.php @@ -1,32 +1,35 @@ - - - + + + + + + - - - + + - - +

Mes projets

-

Mes projets

- - Le projet ' . $project['projectName'] . ' en version ' . $project['versionName'] . '
'); - } - - }else{ - header('Location:401.php'); - } + getID() .'">Le projet ' . $project->getName() . ' en version ' . $version->getName() . '
'); + else + echo ('Le projet ' . $project->getName() . ' sans version
'); + } + + }else{ + header ( 'Location:login.php'); + $_SESSION ['current_error'] = 'C\'est pas que je veut pas ... mais qui êtes vous ?'; + exit; + } ?> -
- - - - \ No newline at end of file +
+ + + diff --git a/registering.php b/registering.php deleted file mode 100644 index 34232f1..0000000 --- a/registering.php +++ /dev/null @@ -1,38 +0,0 @@ -abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_&éèàùçµ"#\'{}()[]|^@°+=$¤£*!§:/;.,?²'; - } - } else { - $_SESSION ['current_error'] = 'Le pseudo sera incorrect : Les seuls caractères autorisés sont :
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_'; - } - } else { - $_SESSION ['current_error'] = 'Tu auras du rentrer deux fois le même mot de passe (tu permet aussi de rendre le champs "Recopier le mot de passe" utile)'; - } -} else { - - $_SESSION ['current_error'] = 'Quand on demande des données , on donne des données !!!'; -} -header ( 'Location:register.php' ); \ No newline at end of file diff --git a/tempPreMega/GebraBezierA12.png b/tempPreMega/GebraBezierA12.png deleted file mode 100644 index efa262b..0000000 Binary files a/tempPreMega/GebraBezierA12.png and /dev/null differ diff --git a/tempPreMega/bezierN.ggb b/tempPreMega/bezierN.ggb deleted file mode 100644 index 9fc47ed..0000000 Binary files a/tempPreMega/bezierN.ggb and /dev/null differ diff --git a/tempPreMega/cercloidCacahuete.png b/tempPreMega/cercloidCacahuete.png deleted file mode 100644 index 838f1dd..0000000 Binary files a/tempPreMega/cercloidCacahuete.png and /dev/null differ diff --git a/tempPreMega/hexaSoucoupe.png b/tempPreMega/hexaSoucoupe.png deleted file mode 100644 index 0fc53d2..0000000 Binary files a/tempPreMega/hexaSoucoupe.png and /dev/null differ diff --git a/tempPreMega/intoDonut.png b/tempPreMega/intoDonut.png deleted file mode 100644 index 648f87e..0000000 Binary files a/tempPreMega/intoDonut.png and /dev/null differ diff --git a/todo.list b/todo.list index cf13024..3b9deb4 100644 --- a/todo.list +++ b/todo.list @@ -1,7 +1,36 @@ -discuts.php -createDiscuts.php -sendMessage.php +--- Debug --- +projet.php : publicy -> authorizedGroup +--- Lacunes de fonctionnalité --- +Bouton "Editer le message" + Ajout de lastModifDate +Boutton "créer un projet" +Page article.php +⤷ Commentaires (message.messageType=1) + ⤷ Edit / Update +Boutton "créer un article" -MEGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -version edit + editing \ No newline at end of file +Page admin +Change file accessibility mechanism +Make tag mechanism more beautyful + +Add text "There is no discussion you can access" (count < 1) + +MEGA !!! + +Sockets pour discut.php -> http://www.raphael-goncalves.fr/blog/chat-temps-reel-en-php-avec-des-websocket + +--- Nouvelles fonctionnalités --- + +SmartURL (pour changements d'ID ou suppression) : b.com/projets/cercloidator ; b.com/projets/cercloidator/3.1415 + +Source code viewer + +"Linux,42,nulix ..." bouton caché dans 404 texte infini amène vers la page de la conspiration microsoftienne + +--- Nouveau projet --- + +Zarbination aléatoire de bernard.com (https://www.dafont.com/fr/unown.font) +Bdd utilitary +RER plan simulator +Pokemon version maths (Discord:Bernard:376096618891444224) +Convertisseur d'unitées communautaire (les utilisateurs créent des methodes "XtoMètre(double val) et MètretoX(double val)" et les publient)