當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DatabaseManager::openTable方法代碼示例

本文整理匯總了PHP中DatabaseManager::openTable方法的典型用法代碼示例。如果您正苦於以下問題:PHP DatabaseManager::openTable方法的具體用法?PHP DatabaseManager::openTable怎麽用?PHP DatabaseManager::openTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DatabaseManager的用法示例。


在下文中一共展示了DatabaseManager::openTable方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addServerNotification

 public function addServerNotification($pNotification, $forceReload = true)
 {
     if ($pNotification instanceof Notification) {
         require_once dirname(__FILE__) . '/DatabaseManager.php';
         $pNotification->setServerMessage(TRUE);
         $databaseManager = new DatabaseManager();
         $databaseManager->openTable('user_permissions', json_decode(DatabaseManager::$table3));
         $notifications = $databaseManager->getValues(array("server_notify" => array("operator" => "=", "value" => "1")));
         if (!empty($notifications) && is_array($notifications)) {
             foreach ($notifications as $user) {
                 $userId = $user['userid'];
                 $this->addNotification($pNotification, $userId, false);
                 // reload will be called later
             }
         }
         if ($forceReload) {
             $this->forceReload();
         }
     }
 }
開發者ID:michaelsoftware1997,項目名稱:vision-server,代碼行數:20,代碼來源:NotificationManager.php

示例2: removeJwtSignature

 public function removeJwtSignature($signature, $userid)
 {
     $databaseAuthtokens = new DatabaseManager();
     $json = json_decode(DatabaseManager::$table11);
     $databaseAuthtokens->openTable("jwt", $json);
     $arrayToken['user'] = array('operator' => '=', 'value' => $userid, 'type' => 'i');
     $arrayToken['signature'] = array('operator' => '=', 'value' => $signature, 'type' => 's');
     $resultToken1 = $databaseAuthtokens->remove($arrayToken);
     return true;
 }
開發者ID:michaelsoftware1997,項目名稱:vision-server,代碼行數:10,代碼來源:LoginManager.php

示例3: unsetSimpleStorage

 function unsetSimpleStorage($name, $device = TRUE, $timestamp = FALSE)
 {
     global $loginManager;
     $databaseManager = new DatabaseManager();
     $databaseManager->openTable("plugin_settings", DatabaseManager::$table8);
     $pluginId = $this->getPluginName();
     $authtoken = $loginManager->getAuthtoken();
     $where = array("name" => array("value" => $name), "plugin" => array("value" => $pluginId));
     if ($device) {
         $where["authtoken"] = array("value" => $authtoken);
     }
     $result = $databaseManager->remove($where);
 }
開發者ID:michaelsoftware1997,項目名稱:vision-server,代碼行數:13,代碼來源:PluginManager.php

示例4: setPermission

 function setPermission($pUserid, $pPermission, $pBool, $autosync = TRUE)
 {
     global $loginManager;
     if (!$loginManager->isAllowed(LoginManager::MODIFY_USERS)) {
         die('[{"type":"heading","value":' . json_encode('Sie dürfen diese Aktion nicht ausführen, da die Rechte welche sie besitzen für diese Aktion nicht ausreichen. Bitte wenden sie sich an den Administrator.') . '}]');
     }
     $pInput = 0;
     if ($pBool) {
         $pInput = 1;
     }
     $database = new DatabaseManager();
     if ($pPermission == LoginManager::STOP_SERVER || $pPermission == LoginManager::MODIFY_USERS || $pPermission == LoginManager::FILE_ACCESS || $pPermission == LoginManager::LOG_ACCESS || $pPermission == LoginManager::SERVER_NOTIFY || $pPermission == LoginManager::START_SERVER || $pPermission == LoginManager::SERVER_CONFIG) {
         $json = json_decode(DatabaseManager::$table3);
         $database->openTable("user_permissions", $json);
         if ($pPermission == LoginManager::STOP_SERVER) {
             if ($database->setValue(array("stop_server" => array("value" => $pInput, "type" => "i")), array("userid" => array("value" => $pUserid, "type" => "i")))) {
                 return true;
             }
         } else {
             if ($pPermission == LoginManager::MODIFY_USERS) {
                 if ($database->setValue(array("modify_users" => array("value" => $pInput)), array("userid" => array("value" => $pUserid)))) {
                     return true;
                 }
             } else {
                 if ($pPermission == LoginManager::FILE_ACCESS) {
                     if ($database->setValue(array("access_files" => array("value" => $pInput, "type" => "i")), array("userid" => array("value" => $pUserid, "type" => "i")))) {
                         return true;
                     }
                 } else {
                     if ($pPermission == LoginManager::LOG_ACCESS) {
                         if ($database->setValue(array("log_access" => array("value" => $pInput, "type" => "i")), array("userid" => array("value" => $pUserid, "type" => "i")))) {
                             return true;
                         }
                     } else {
                         if ($pPermission == LoginManager::SERVER_NOTIFY) {
                             if ($database->setValue(array("server_notify" => array("value" => $pInput, "type" => "i")), array("userid" => array("value" => $pUserid, "type" => "i")))) {
                                 return true;
                             }
                         } else {
                             if ($pPermission == LoginManager::START_SERVER) {
                                 if ($database->setValue(array("start_server" => array("value" => $pInput, "type" => "i")), array("userid" => array("value" => $pUserid, "type" => "i")))) {
                                     return true;
                                 }
                             } else {
                                 if ($pPermission == LoginManager::SERVER_CONFIG) {
                                     if ($database->setValue(array("server_config" => array("value" => $pInput, "type" => "i")), array("userid" => array("value" => $pUserid, "type" => "i")))) {
                                         return true;
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         if ($autosync) {
             sync(USER_PERMISSIONS);
         }
     } else {
         if (!empty($pPermission)) {
             $json = DatabaseManager::$table4;
             $json = json_decode($json);
             $database->openTable("custom_user_permissions", $json);
             if ($database->insertOrUpdateValue(array("value" => array("value" => $pInput, "type" => "i")), array("user" => array("value" => $pUserid, "type" => "i"), "permission_name" => array("value" => $pPermission, "type" => "s")))) {
                 return true;
             }
         }
     }
     return false;
 }
開發者ID:michaelsoftware1997,項目名稱:vision-server,代碼行數:70,代碼來源:UserManager.php


注:本文中的DatabaseManager::openTable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。