本文整理汇总了PHP中AdminHandler类的典型用法代码示例。如果您正苦于以下问题:PHP AdminHandler类的具体用法?PHP AdminHandler怎么用?PHP AdminHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AdminHandler类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
$this->connection = getConnection();
$this->collectionHandler = new CollectionHandler($this->connection);
$this->collectionHandler->create('ArangoDB_PHP_TestSuite_IndexTestCollection');
$adminHandler = new AdminHandler($this->connection);
$version = $adminHandler->getServerVersion();
$this->hasSparseIndexes = version_compare($version, '2.5.0') >= 0;
$this->hasSelectivityEstimates = version_compare($version, '2.5.0') >= 0;
}
开发者ID:TomSearch,项目名称:arangodb-php-docs,代码行数:10,代码来源:CollectionBasicTest.php
示例2: isCluster
function isCluster(Connection $connection)
{
static $isCluster = null;
if ($isCluster === null) {
$adminHandler = new AdminHandler($connection);
try {
$role = $adminHandler->getServerRole();
$isCluster = $role === 'COORDINATOR' || $role === 'DBSERVER';
} catch (\Exception $e) {
// maybe server version is too "old"
$isCluster = false;
}
}
return $isCluster;
}
开发者ID:vinigomescunha,项目名称:ArangoDB-Ajax-PHP-Example,代码行数:15,代码来源:bootstrap.php
示例3: index
/**
* Display site admin index page.
*/
function index()
{
AdminHandler::validate();
AdminHandler::setupTemplate();
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('helpTopicId', 'site.index');
$templateMgr->display('admin/index.tpl');
}
开发者ID:alenoosh,项目名称:ojs,代码行数:11,代码来源:AdminHandler.inc.php
示例4: setUp
public function setUp()
{
$this->connection = getConnection();
$this->collectionHandler = new CollectionHandler($this->connection);
// clean up first
try {
$this->collectionHandler->drop('ArangoDB_PHP_TestSuite_TestCollection');
} catch (\Exception $e) {
// don't bother us, if it's already deleted.
}
$this->collection = new Collection();
$this->collection->setName('ArangoDB_PHP_TestSuite_TestCollection');
$this->collectionHandler->add($this->collection);
$this->documentHandler = new DocumentHandler($this->connection);
$adminHandler = new AdminHandler($this->connection);
$version = preg_replace("/-[a-z0-9]+\$/", "", $adminHandler->getServerVersion());
$this->hasExportApi = version_compare($version, '2.6.0') >= 0;
}
开发者ID:vinigomescunha,项目名称:ArangoDB-Ajax-PHP-Example,代码行数:18,代码来源:ExportTest.php
示例5: AdminFunctionsHandler
/**
* Constructor
**/
function AdminFunctionsHandler()
{
parent::AdminHandler();
}
开发者ID:sedici,项目名称:ocs,代码行数:7,代码来源:AdminFunctionsHandler.inc.php
示例6: Response
return new Response('Unauthorized', 401);
}
$object = array('admin_id' => $admin_id, 'role_id' => $request->get('role_id'));
$handler = new AdminHandler();
$result = $handler->updateRole($object);
return new Response($result['message'], $result['status_code']);
});
// Update password
$app->POST('/admin/{admin_id}/password', function (Application $app, Request $request, $admin_id) {
if (!authenticate('user', $admin_id)) {
return new Response('Unauthorized', 401);
}
$object = array('admin_id' => $admin_id, 'password' => $request->get('password'));
$handler = new AdminHandler();
$result = $handler->updatePassword($object);
return new Response($result['message'], $result['status_code']);
});
// Delete admin
$app->DELETE('/admin/{admin_id}', function (Application $app, Request $request, $admin_id) {
if (!authenticate('1', null)) {
return new Response('Unauthorized', 401);
}
$handler = new AdminHandler();
$result = $handler->delete($admin_id);
return new Response($result['message'], $result['status_code']);
});
// optional geolocation in body
$app->GET('/businesses/{category}/{subcategory}', function (Application $app, Request $request, $subcategory) {
return new Response('How about implementing businessRepairSubcategoryGet as a GET method ?');
});
$app->run();
开发者ID:fitzsimk,项目名称:Reuse-and-Repair,代码行数:31,代码来源:index.php
示例7: safepost
require_once 'common.php';
if ($CONF['configured'] !== true) {
print "Installation not yet configured; please edit config.inc.php or write your settings to config.local.php";
exit;
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$lang = safepost('lang');
$fUsername = trim(safepost('fUsername'));
$fPassword = safepost('fPassword');
if ($lang != check_language(0)) {
# only set cookie if language selection was changed
setcookie('lang', $lang, time() + 60 * 60 * 24 * 30);
# language cookie, lifetime 30 days
# (language preference cookie is processed even if username and/or password are invalid)
}
$h = new AdminHandler();
if ($h->login($fUsername, $fPassword)) {
session_regenerate_id();
$_SESSION['sessid'] = array();
$_SESSION['sessid']['roles'] = array();
$_SESSION['sessid']['roles'][] = 'admin';
$_SESSION['sessid']['username'] = $fUsername;
$_SESSION['PFA_token'] = md5(uniqid(rand(), true));
# they've logged in, so see if they are a domain admin, as well.
if (!$h->init($fUsername)) {
flash_error($PALANG['pLogin_failed']);
}
if (!$h->view()) {
flash_error($PALANG['pLogin_failed']);
}
$adminproperties = $h->result();
开发者ID:mpietruschka,项目名称:postfixadmin,代码行数:31,代码来源:login.php
示例8: AdminLanguagesHandler
/**
* Constructor
*/
function AdminLanguagesHandler()
{
parent::AdminHandler();
}
开发者ID:artkuo,项目名称:ocs,代码行数:7,代码来源:AdminLanguagesHandler.inc.php
示例9: AdminSettingsHandler
function AdminSettingsHandler()
{
parent::AdminHandler();
}
开发者ID:jerico-dev,项目名称:omp,代码行数:4,代码来源:AdminSettingsHandler.inc.php
示例10: AdminPressHandler
function AdminPressHandler()
{
parent::AdminHandler();
}
开发者ID:ramonsodoma,项目名称:omp,代码行数:4,代码来源:AdminPressHandler.inc.php
示例11: error_reporting
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'on');
require_once 'init.php';
checkInstalled($pollDb, $config);
$pollRepository = new DbPollRepository($pollDb, $config['database']['prefix']);
$requestRepository = new DefaultRequestRepository();
if ($config['admin']['type'] == 'default') {
$adminInteractor = new AdminInteractor($config['admin']);
} elseif (isset($config['admin']['interactor']) && $config['admin']['interactor'] instanceof AdminInteractorInterface) {
$adminInteractor = $config['admin']['interactor'];
}
$pollInteractor = new PollInteractor($pollRepository, $requestRepository);
$adminHandler = new AdminHandler($pollInteractor, $adminInteractor);
$indexHandler = new IndexHandler($pollInteractor);
if (!isset($_GET['c'])) {
$_GET['c'] = '';
}
if (!isset($_GET['a'])) {
$_GET['a'] = '';
}
switch ($_GET['c']) {
case 'admin':
$adminHandler->Route($_GET['a']);
break;
case 'index':
default:
$indexHandler->Route($_GET['a']);
break;
}
开发者ID:camargoanderso,项目名称:Simple-Poll-Engine,代码行数:31,代码来源:index.php
示例12: AdminFunctionsHandler
/**
* Constructor
*/
function AdminFunctionsHandler()
{
parent::AdminHandler();
$this->addRoleAssignment(array(ROLE_ID_SITE_ADMIN), array('systemInfo', 'editSystemConfig', 'saveSystemConfig', 'phpinfo', 'expireSessions', 'clearTemplateCache', 'clearDataCache', 'downloadScheduledTaskLogFile', 'clearScheduledTaskLogFiles'));
}
开发者ID:jprk,项目名称:pkp-lib,代码行数:8,代码来源:AdminFunctionsHandler.inc.php
示例13: AdminConferenceHandler
/**
* Constructor
**/
function AdminConferenceHandler()
{
parent::AdminHandler();
}
开发者ID:ramonsodoma,项目名称:ocs,代码行数:7,代码来源:AdminConferenceHandler.inc.php
示例14: AuthSourcesHandler
/**
* Constructor
**/
function AuthSourcesHandler()
{
parent::AdminHandler();
}
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:7,代码来源:AuthSourcesHandler.inc.php
示例15: PluginManagementHandler
/**
* Constructor
**/
function PluginManagementHandler()
{
parent::AdminHandler();
}
开发者ID:ramonsodoma,项目名称:harvester,代码行数:7,代码来源:PluginManagementHandler.inc.php
示例16: testCreateAndDeleteDocumentWithSeveralKeys
/**
* Try to create and delete a document with several keys
*/
public function testCreateAndDeleteDocumentWithSeveralKeys()
{
$connection = $this->connection;
$collection = $this->collection;
$documentHandler = new DocumentHandler($connection);
$keys = array("_", "foo", "bar", "bar:bar", "baz", "1", "0", "a-b-c", "a:b", "this-is-a-test", "FOO", "BAR", "Bar", "bAr");
$adminHandler = new AdminHandler($this->connection);
$version = preg_replace("/-[a-z0-9]+\$/", "", $adminHandler->getServerVersion());
if (version_compare($version, '2.6.0') >= 0) {
// 2.6 will also allow the following document keys, while 2.5 will not
$keys[] = ".";
$keys[] = ":";
$keys[] = "@";
$keys[] = "-.:@";
$keys[] = "[email protected]";
$keys[] = ":.foo@bar-bar_bar.baz.com.:";
}
foreach ($keys as $key) {
$document = new Document();
$document->someAttribute = 'someValue';
$document->set('_key', $key);
$documentId = $documentHandler->add($collection->getName(), $document);
$resultingDocument = $documentHandler->get($collection->getName(), $documentId);
$resultingAttribute = $resultingDocument->someAttribute;
$resultingKey = $resultingDocument->getKey();
$this->assertTrue($resultingAttribute === 'someValue', 'Resulting Attribute should be "someValue". It\'s :' . $resultingAttribute);
$this->assertTrue($resultingKey === $key, 'Resulting Attribute should be "someValue". It\'s :' . $resultingKey);
$documentHandler->delete($document);
}
}
开发者ID:vinigomescunha,项目名称:ArangoDB-Ajax-PHP-Example,代码行数:33,代码来源:DocumentBasicTest.php
示例17: create_admin
function create_admin($values)
{
DEFINE('POSTFIXADMIN_SETUP', 1);
# avoids instant redirect to login.php after creating the admin
$handler = new AdminHandler(1, 'setup.php');
$formconf = $handler->webformConfig();
if (!$handler->init($values['username'])) {
return array(1, "", $handler->errormsg);
}
if (!$handler->set($values)) {
return array(1, "", $handler->errormsg);
}
if (!$handler->store()) {
return array(1, "", $handler->errormsg);
}
return array(0, $handler->infomsg['success'], array());
}
开发者ID:skamayker,项目名称:docker_mail,代码行数:17,代码来源:setup.php
示例18: AdminPeopleHandler
/**
* Constructor
**/
function AdminPeopleHandler()
{
parent::AdminHandler();
}
开发者ID:jmacgreg,项目名称:ocs,代码行数:7,代码来源:AdminPeopleHandler.inc.php
示例19: AdminContextHandler
/**
* Constructor
*/
function AdminContextHandler()
{
parent::AdminHandler();
$this->addRoleAssignment(array(ROLE_ID_SITE_ADMIN), array('contexts'));
}
开发者ID:jprk,项目名称:pkp-lib,代码行数:8,代码来源:AdminContextHandler.inc.php
示例20: __construct
public function __construct()
{
self::$facets = array(_t('More than .. posts') => 'morethan', _t('Less than .. posts') => 'lessthan', _t('Order by') => 'orderby');
self::$facet_values = array('orderby' => array(_t('Publication date (descending)') => 'pubdate_desc', _t('Publication date (ascending)') => 'pubdate_asc', _t('Post count (descending)') => 'count_desc', _t('Post count (ascending)') => 'count_asc', _t('Alphabetical (descending)') => 'alphabetical_desc', _t('Alphabetical (ascending)') => 'alphabetical_asc'));
// We could avoid "translating" for sure, but it adds an additional layer of security, so we keep it
self::$orderby_translate = array('pubdate' => 'pubdate', 'count' => 'count', 'alphabetical' => 'term_display');
return parent::__construct();
}
开发者ID:habari,项目名称:system,代码行数:8,代码来源:admintagshandler.php
注:本文中的AdminHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论