From 78ace8037f01c64f1615839d9eeb7398d63bf0e4 Mon Sep 17 00:00:00 2001 From: franzz Date: Mon, 26 Jun 2017 14:05:38 +1200 Subject: [PATCH] remove svn files --- current_version/classes/.svn/all-wcprops | 41 ---- current_version/classes/.svn/entries | 232 ------------------ .../.svn/text-base/database.php.svn-base | 90 ------- .../.svn/text-base/input_box.php.svn-base | 135 ---------- .../.svn/text-base/page_switch.php.svn-base | 90 ------- .../classes/.svn/text-base/qcm.php.svn-base | 91 ------- .../classes/.svn/text-base/query.php.svn-base | 84 ------- .../.svn/text-base/session.php.svn-base | 115 --------- 8 files changed, 878 deletions(-) delete mode 100644 current_version/classes/.svn/all-wcprops delete mode 100644 current_version/classes/.svn/entries delete mode 100644 current_version/classes/.svn/text-base/database.php.svn-base delete mode 100644 current_version/classes/.svn/text-base/input_box.php.svn-base delete mode 100644 current_version/classes/.svn/text-base/page_switch.php.svn-base delete mode 100644 current_version/classes/.svn/text-base/qcm.php.svn-base delete mode 100644 current_version/classes/.svn/text-base/query.php.svn-base delete mode 100644 current_version/classes/.svn/text-base/session.php.svn-base diff --git a/current_version/classes/.svn/all-wcprops b/current_version/classes/.svn/all-wcprops deleted file mode 100644 index 5cbb9ea..0000000 --- a/current_version/classes/.svn/all-wcprops +++ /dev/null @@ -1,41 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 47 -/svn/!svn/ver/203/trunk/current_version/classes -END -page_switch.php -K 25 -svn:wc:ra_dav:version-url -V 63 -/svn/!svn/ver/142/trunk/current_version/classes/page_switch.php -END -qcm.php -K 25 -svn:wc:ra_dav:version-url -V 55 -/svn/!svn/ver/132/trunk/current_version/classes/qcm.php -END -session.php -K 25 -svn:wc:ra_dav:version-url -V 59 -/svn/!svn/ver/187/trunk/current_version/classes/session.php -END -database.php -K 25 -svn:wc:ra_dav:version-url -V 60 -/svn/!svn/ver/181/trunk/current_version/classes/database.php -END -query.php -K 25 -svn:wc:ra_dav:version-url -V 57 -/svn/!svn/ver/187/trunk/current_version/classes/query.php -END -input_box.php -K 25 -svn:wc:ra_dav:version-url -V 61 -/svn/!svn/ver/203/trunk/current_version/classes/input_box.php -END diff --git a/current_version/classes/.svn/entries b/current_version/classes/.svn/entries deleted file mode 100644 index 28dd473..0000000 --- a/current_version/classes/.svn/entries +++ /dev/null @@ -1,232 +0,0 @@ -10 - -dir -204 -https://qcmmaker.googlecode.com/svn/trunk/current_version/classes -https://qcmmaker.googlecode.com/svn - - - -2011-02-04T12:53:02.612682Z -203 -Francois.Lutran - - - - - - - - - - - - - - -1abcc3b6-0f78-11df-b47a-af0d17c1a499 - -page_switch.php -file - - - - -2010-05-27T12:39:51.000000Z -2329eae6f4e08390ea0f3b6473c032ac -2010-05-26T15:19:46.928829Z -142 -francois.lutran - - - - - - - - - - - - - - - - - - - - - -2262 - -qcm.php -file - - - - -2010-05-17T13:58:31.000000Z -a42c09f4317dbd6b042ea456cd133504 -2010-05-16T21:14:21.358495Z -132 -Francois.Lutran - - - - - - - - - - - - - - - - - - - - - -2410 - -session.php -file - - - - -2010-09-11T11:41:49.000000Z -b3fd2f8bc728ba7b9218c44d4ee0c0c3 -2010-09-09T13:24:00.096915Z -187 -francois.lutran - - - - - - - - - - - - - - - - - - - - - -2547 - -database.php -file - - - - -2010-06-24T18:14:17.000000Z -091eec56e6da0e3e8b4f7dae2cf907de -2010-06-24T15:03:08.973390Z -181 -francois.lutran - - - - - - - - - - - - - - - - - - - - - -1361 - -query.php -file - - - - -2010-09-11T11:41:49.000000Z -93106e8c9d51d8c84482b91a00d71949 -2010-09-09T13:24:00.096915Z -187 -francois.lutran - - - - - - - - - - - - - - - - - - - - - -2006 - -input_box.php -file - - - - -2011-02-05T22:56:04.669525Z -dc3493321c6afd35e661efdb1b43ee1f -2011-02-04T12:53:02.612682Z -203 -Francois.Lutran - - - - - - - - - - - - - - - - - - - - - -3460 - diff --git a/current_version/classes/.svn/text-base/database.php.svn-base b/current_version/classes/.svn/text-base/database.php.svn-base deleted file mode 100644 index fbba6a2..0000000 --- a/current_version/classes/.svn/text-base/database.php.svn-base +++ /dev/null @@ -1,90 +0,0 @@ -setConnection(); - } - - //TODO from here on - - private function setConnection() - { - $this->oConnection = connection(); - } - - - - function install($oConnection) - { - install(); - } - - function getInstallQuery($sTable) - { - getInstallQuery($sTable); - } - - /** - * @static - * @return array db tables - */ - public function getTables() - { - return getTables(); - } - - /** - * @static - * @return array db qcm related tables - */ - public function getQcmTables() - { - return getQcmTables(); - } - - public function getChangeLogEnum() - { - return getChangeLogEnum(); - } - - function getTableColumns($sTable, $sColumnName=false) - { - return getTableColumns($sTable, $sColumnName); - } - function getTableConstraints($sTable) - { - return getTableConstraints($sTable); - } - - function getQuote($sTable, $sColumnName) - { - return getQuote($sTable, $sColumnName); - } - - function getTableColumnNames($sTableName, $iTableColumn=0) - { - return getTableColumnNames($sTableName, $iTableColumn); - } - function getId($sTableName) - { - return getId($sTableName); - } -} \ No newline at end of file diff --git a/current_version/classes/.svn/text-base/input_box.php.svn-base b/current_version/classes/.svn/text-base/input_box.php.svn-base deleted file mode 100644 index 94f7859..0000000 --- a/current_version/classes/.svn/text-base/input_box.php.svn-base +++ /dev/null @@ -1,135 +0,0 @@ -iBoxId = 'input_box_id_'.rand(1, 1000); - $this->sBoxTitle = $sBoxTitle; - $this->sQuestion = $sQuestion; - $this->setAnswers($asAnswers); - $this->setStyle($asStyle); - $this->setTags(array()); - } - - function setAnswers($asAnswers) - { - if(count($asAnswers)==0) - { - $this->asAnswers = array('Oui'=>'submitForm(\'#formName#\')', 'Non'=>''); - } - else - { - $this->asAnswers = $asAnswers; - } - } - - function getAnswers() - { - $sAnswers = ''; - foreach($this->asAnswers as $sAnswertext=>$sAnswerAction) - { - $sAnswers .= ''; - } - return $sAnswers; - } - - function setStyle($asStyle) - { - $this->asStyle = array('display'=>'none', 'position'=>'absolute'); - $this->asStyle = array_merge($this->asStyle, $asStyle); - } - - function getStyle() - { - $sStyle = ''; - foreach($this->asStyle as $sStyleTag=>$sStyleValue) - { - $sStyle .= $sStyleTag.':'.$sStyleValue.';'; - } - return $sStyle; - } - - function setTags($asTags) - { - $this->asTagNames = $asTags; - } - - function getTag($sTagName=false, $bKey=false, $bJavaScript=false) - { - return ($sTagName===false)?$this->asTagNames:$this->asTagNames[$sTagName]; - } - - function getTagNames() - { - return array_keys($this->getTag()); - } - - function getJavaScript() - { - $asTagReplace = array(); - foreach($this->getTagNames() as $sTagName) - { - $asTagReplace[] = 'box = box.replace(/\#'.$sTagName.'\#/g, '.$sTagName.');'; - } - - return ''; - } - - function getAction() - { - return 'setInputBox_'.$this->iBoxId.'(\''.implode('\', \'', array_map('addslashes', $this->getTag())).'\');'; - } - - function getBox() - { - return '
- '.$this->sBoxTitle.' -

'.$this->sQuestion.'

-
'.$this->getAnswers().'
-
'; - } - - function getHtml() - { - return "\n".$this->getJavaScript()."\n".'
'; - } -} -?> \ No newline at end of file diff --git a/current_version/classes/.svn/text-base/page_switch.php.svn-base b/current_version/classes/.svn/text-base/page_switch.php.svn-base deleted file mode 100644 index fe5affe..0000000 --- a/current_version/classes/.svn/text-base/page_switch.php.svn-base +++ /dev/null @@ -1,90 +0,0 @@ -sPageVar = $sPageVar; - $this->iItemNb = $iTotalItemNb; - $this->iLimit = $iLimit; - $this->sExtraRefPageVar = $sExtraRefPageVar; - - //parse url - $asUrlParts = parse_url($_SERVER['REQUEST_URI']); - if(isset($asUrlParts['query'])) - { - parse_str($asUrlParts['query'], $asUrlVariables); - - $this->sRefPage = $asUrlVariables['page']; - $this->iPageNumber = isset($asUrlVariables[$this->sPageVar])?$asUrlVariables[$this->sPageVar]:1; - } - else - { - $this->sRefPage = DEFAULT_LOGGED_PAGE; - $this->iPageNumber = 1; - } - - $this->setNextPageLinkTitle(); - $this->setPrevPageLinkTitle(); - } - - public function setNextPageLinkTitle($sTitle='>') - { - $this->sNextPageLinkTitle = $sTitle; - } - public function setPrevPageLinkTitle($sTitle='<') - { - $this->sPrevPageLinkTitle = $sTitle; - } - - public function getItemStartPointer() - { - return (max(0, $this->iPageNumber-1))*$this->iLimit; - } - - public function getItemRange() - { - $iItemStartPointer = $this->getItemStartPointer(); - return array('start'=>$iItemStartPointer+1, 'end'=>min($this->iItemNb, $iItemStartPointer+$this->iLimit)); - } - - public function getNextLink() - { - return $this->isNextPage()?$this->getPage($this->sNextPageLinkTitle, 1):''; - } - - public function getPrevLink() - { - return $this->isPrevPage()?$this->getPage($this->sPrevPageLinkTitle, -1):''; - } - - private function isNextPage() - { - return (($this->iItemNb - ($this->iPageNumber-1)*$this->iLimit) > $this->iLimit); - } - - private function isPrevPage() - { - return ($this->iPageNumber > 1); - } - - private function getPage($sTitle, $iDir) - { - $iPageNb = max(1, $this->iPageNumber + $iDir); - return getHtml($sTitle, 'a', 'XButton rounded', 'font-size:12px;border-color:white;', array('href'=>'?page='.$this->sRefPage.'&'.$this->sPageVar.'='.$iPageNb)); - } -} \ No newline at end of file diff --git a/current_version/classes/.svn/text-base/qcm.php.svn-base b/current_version/classes/.svn/text-base/qcm.php.svn-base deleted file mode 100644 index 7d57f40..0000000 --- a/current_version/classes/.svn/text-base/qcm.php.svn-base +++ /dev/null @@ -1,91 +0,0 @@ - question - private $asImages; - - //Answers - private $asAnswerTitle; // id_answer => answer - private $asRightAnswers; - private $asAnswerQuestion; // id_question =>> id_answers - - //Results - private $asResults; // id_user => mark - private $asDates; // id_user => led - - public function __construct($oDataBase, $iQcmId=false) - { - $this->oDataBase = $oDataBase; - - if($iQcmId!==false) - { - //Qcm - $test = array_values(selectRow(QCM_TABLE, array($iQcmId), false, true)); - list($this->iQcmId, $this->sAuthor, $this->sQcmName, $this->bValid, $this->sLastModifiedOn) = $test; - - //Questions - $asQuestions = selectRows(array('from'=>QUESTION_TABLE, 'constraint'=>array('id_'.QCM_TABLE=>$this->iQcmId))); - pre($asQuestions, '', true); - foreach($asQuestions as $asRow) - { - $this->asQuestionTitle[$asRow['id_'.QUESTION_TABLE]] = $asRow[QUESTION_TABLE]; - $this->asImages[$asRow['id_'.QUESTION_TABLE]] = $asRow['image']; - $this->asQuestions[$asRow['id_'.QUESTION_TABLE]] = array(QUESTION_TABLE=>$asRow[QUESTION_TABLE], 'image'=>$asRow['image']); - } - - //Answers - $asAnswers = selectRows(array('from'=>ANSWER_TABLE, 'constraint'=>array('id_'.QCM_TABLE=>$this->iQcmId))); - foreach($asAnswers as $asRow) - { - $this->asAnswerTitle[$asRow['id_'.ANSWER_TABLE]] = $asRow[ANSWER_TABLE]; - $this->asRightAnswers[$asRow['id_'.ANSWER_TABLE]] = $asRow[RIGHT_ANSWER]; - $this->asAnswerQuestion[$asRow['id_'.ANSWER_TABLE]] = $asRow['id_'.QUESTION_TABLE]; - $this->asAnswers[$asRow['id_'.ANSWER_TABLE]] = array(); //TODO - } - - //Results - $asResults = selectRows(array('from'=>RESULT_TABLE, 'constraint'=>array('id_'.QCM_TABLE=>$this->iQcmId))); - foreach($asResults as $asRow) - { - $this->asResults[$asRow['id_'.USER_TABLE]] = $asRow[RESULT_TABLE]; - $this->asDates[$asRow['id_'.USER_TABLE]] = $asRow['led']; - } - } - } - - function getQcm() - { - - } - - function getQuestions() - { - - } - - function getAnswers($iQuestionId) - { - - } - - function cloneQcm() - { - $oClonedQcm = new qcm($this->oDataBase); - - return $oClonedQcm; - } -} \ No newline at end of file diff --git a/current_version/classes/.svn/text-base/query.php.svn-base b/current_version/classes/.svn/text-base/query.php.svn-base deleted file mode 100644 index d321dee..0000000 --- a/current_version/classes/.svn/text-base/query.php.svn-base +++ /dev/null @@ -1,84 +0,0 @@ -oMySql = $oMySql; - $asSelections = $asSources = $asConstraints = $asOrders = $asGroups = array(); - } - - public function addSelect() - { - - } - - /* - function selectRows($asInfo) - { - $sAttributes = array('select'=>"SELECT", 'from'=>"FROM", 'constraint'=>"WHERE", 'groupBy'=>"GROUP BY", 'orderBy'=>"ORDER BY"); - $asRowSeparators = array('select'=>", ", 'from'=>"", 'constraint'=>" AND ", 'groupBy'=>", ", 'orderBy'=>", "); - $asOperators = array('constraint'=>" = ", 'orderBy'=>" "); - - $sQuery = ""; - foreach($sAttributes as $sStatement => $sKeyWord) - { - $asSelection = array_key_exists($sStatement, $asInfo)?$asInfo[$sStatement]:array(); - if(!is_array($asSelection)) - { - $asSelection = array($asSelection); - } - - //if provided values - if(count($asSelection)>0) - { - cleanSql($asSelection); - $sQuery .= " ".$sKeyWord." "; - - //in case of double value input - if(array_key_exists($sStatement, $asOperators)) - { - $sQuery .= implodeAll($asSelection, $asOperators[$sStatement], $asRowSeparators[$sStatement]); - } - else - { - $sQuery .= implode($asRowSeparators[$sStatement], $asSelection); - } - } - //default value for select - elseif($sStatement=='select') - { - $sQuery .= " ".$sKeyWord." * "; - } - } - - return getArrayQuery($sQuery, true); - } - - function implodeAll($asText, $sKeyValueSeparator='', $sRowSeparator='', $sKeyPre='', $sValuePost=false) - { - if($sValuePost===false) - { - $sValuePost = $sKeyPre; - } - $asCombinedText = array(); - foreach($asText as $sKey=>$sValue) - { - $asCombinedText[] = $sKeyPre.$sKey.$sKeyValueSeparator.$sValue.$sValuePost; - } - return implode($sRowSeparator, $asCombinedText); - } - */ -} - -?> \ No newline at end of file diff --git a/current_version/classes/.svn/text-base/session.php.svn-base b/current_version/classes/.svn/text-base/session.php.svn-base deleted file mode 100644 index 380851d..0000000 --- a/current_version/classes/.svn/text-base/session.php.svn-base +++ /dev/null @@ -1,115 +0,0 @@ -asErrorStack = array(); - } - - function addError($sError) - { - $this->asErrorStack[] = $sError; - } - - function getCleanErrorStack() - { - $sErrorStack = implode("\n", $this->asErrorStack); - $this->asErrorStack = array(); - return $sErrorStack; - } - - function __destruct() - { - file_put_contents('log.html', "\n\n".date('r')."\n".$this->getCleanErrorStack(), FILE_APPEND); - } -} - -class Session extends PhpObject -{ - private $iUserId; - private $sLogin; - private $oMySql; - - public function __construct($oMySql) - { - parent::__construct(); - $iUserId = $sLogin = false; - $this->oMySql = $oMySql; - $this->syncSession(); - } - - private function syncSession() - { - if(isset($_SESSION['id_user'])) - { - $this->iUserId = $_SESSION['id_user']; - } - if(isset($_SESSION['login'])) - { - $this->sLogin = $_SESSION['login']; - } - } - - private function setSession($iUserId, $sLogin) - { - $_SESSION['id_user'] = $iUserId; - $_SESSION['login'] = $sLogin; - $this->syncSession(); - } - - public function logMeIn($sLogin, $sPass) - { - $asUser = $this->oMySql->selectRow(MySqlManager::USER_TABLE, array(MySqlManager::USER_TABLE=>$sLogin)); - if(!$asUser) - { - $this->addError('Utilisateur inconnu'); - } - elseif($this->checkPassword($sPass, $asUser['pass'])) - { - $this->setSession($asUser['id_'.MySqlManager::USER_TABLE], $sLogin); - return true; - } - else - { - $this->addError('mot de pass incorrect'); - } - return false; - } - - public function isLogguedIn() - { - $bLogguedIn = false; - if(isset($_SESSION['id_user']) && isset($_SESSION['login']) && $_SESSION['id_user']!='' && $_SESSION['login']!='') - { - $bLogguedIn = $this->oMySql->selectValue(MySqlManager::USER_TABLE, 'COUNT(1)', array('id_'.MySqlManager::USER_TABLE=>$_SESSION['id_user'], MySqlManager::USER_TABLE=>$_SESSION['login'])); - } - return $bLogguedIn; - } - - public function logMeOut() - { - $_SESSION = array(); - return session_destroy(); - } - - public static function encryptPassword($sPass) - { - $sRandomText = 'F_RA-1H2dsdj)5fsd3sdPKUsdIN@(sZ.'; - for($iIndex=0; $iIndex < strlen($sPass); $iIndex++) - { - $sPass[$iIndex] = $sRandomText[$iIndex%strlen($sRandomText)] ^ $sPass[$iIndex]; - } - return md5($sPass); - } - private function checkPassword($sClearPass, $sEncodedPass) - { - return $this->encryptPassword($sClearPass) == $sEncodedPass; - } - -} -?> \ No newline at end of file