コード例 #1
0
ファイル: users.php プロジェクト: radjybaba/testserver
 private static function create_new_token($username)
 {
     try {
         $token = users::generateRandomString();
         $dbObj = new dbAPI();
         $query = "UPDATE users SET TOKEN = '" . $token . "' where USERNAME = '******'";
         $results = $dbObj->run_query($dbObj->db_get_usersDB(), $query);
         if ($results) {
             echo $results;
             return $token;
         }
         debugLog::debug_log("create token for user: "******" has failed");
         return null;
     } catch (Exception $e) {
         echo 'Caught exception: ', $e->getMessage(), "\n";
     }
 }
コード例 #2
0
ファイル: debugLog.php プロジェクト: radjybaba/testserver
 public static function log($message)
 {
     debugLog::debug_log($message);
 }
コード例 #3
0
ファイル: term.php プロジェクト: radjybaba/testserver
 public static function add_translation_to_term_meaning($meaning_UID, $text, $lang, $user)
 {
     // check if a term meaning exists
     if (term::get_term_meaning_by_UID($meaning_UID) == null) {
         debugLog::debug_log("could not locate the term meaning '" . $meaning_UID . "'");
         return null;
     }
     // check if the same translation exists
     if (term::get_term_meaning_by_UID($meaning_UID, $lang) != null) {
         debugLog::debug_log("adding translation to term meaning ('" . $meaning_UID . "') with already existing language ('" . $lang . "') is prohibited");
         return null;
     }
     $dbObj = new dbAPI();
     // add record to database
     $query = "INSERT INTO TERM_MEAN (UID, TEXT, LANG, ENABLED, USER_ID, CREATION_DATE) VALUES (" . $meaning_UID . ", '" . $text . "', '" . $lang . "', 1, " . $user . ",'" . date("Y-m-d H:i:s") . "')";
     $dbObj->run_query($dbObj->db_get_contentDB(), $query);
     // returns an entity of recently added scope
     return term::get_term_meaning_by_UID($meaning_UID, $lang);
 }
コード例 #4
0
ファイル: DBobject.php プロジェクト: radjybaba/testserver
 public function disable_revision($database_name, $table_name, $whereSttmnt)
 {
     $query = "UPDATE " . $table_name . " SET ENABLED = 0 WHERE " . $whereSttmnt . " ";
     $results = $this->run_query($database_name, $query);
     if ($results) {
         // on success
         return true;
     }
     debugLog::debug_log("[disable_revision]: could not disbale rivision. [query]: <br>" . $query . "<hr>");
     return false;
 }