当前位置: 首页>>代码示例>>PHP>>正文


PHP User::checkAdminUser方法代码示例

本文整理汇总了PHP中OCP\User::checkAdminUser方法的典型用法代码示例。如果您正苦于以下问题:PHP User::checkAdminUser方法的具体用法?PHP User::checkAdminUser怎么用?PHP User::checkAdminUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OCP\User的用法示例。


在下文中一共展示了User::checkAdminUser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: savepolicy

 public function savepolicy($minlength, $hasmixedcase, $hasnumbers, $hasspecialchars, $specialcharslist)
 {
     \OCP\User::checkAdminUser();
     $hasspecialchars = $hasspecialchars == 0 ? "false" : "true";
     $hasmixedcase = $hasmixedcase == 0 ? "false" : "true";
     $hasnumbers = $hasnumbers == 0 ? "false" : "true";
     $this->service->setAppValue('minlength', $minlength);
     $this->service->setAppValue('hasmixedcase', $hasmixedcase);
     $this->service->setAppValue('hasnumbers', $hasnumbers);
     $this->service->setAppValue('hasspecialchars', $hasspecialchars);
     $this->service->setAppValue('specialcharslist', $specialcharslist);
     return true;
 }
开发者ID:r2evans,项目名称:passwordpolicy,代码行数:13,代码来源:passwordpolicycontroller.php

示例2: runChecks

 /**
  * Runs all security checks
  */
 public function runChecks()
 {
     if ($this->csrfCheck) {
         \OCP\JSON::callCheck();
     }
     if ($this->loggedInCheck) {
         \OCP\JSON::checkLoggedIn();
     }
     if ($this->appEnabledCheck) {
         \OCP\JSON::checkAppEnabled($this->appName);
     }
     if ($this->isAdminCheck) {
         \OCP\User::checkAdminUser();
     }
 }
开发者ID:noldmess,项目名称:apps,代码行数:18,代码来源:security.php

示例3: deleteServerConfiguration

    /**
     * @brief deletes a given saved LDAP/AD server configuration.
     * @param string the configuration prefix of the config to delete
     * @return bool true on success, false otherwise
     */
    public static function deleteServerConfiguration($prefix)
    {
        //just to be on the safe side
        \OCP\User::checkAdminUser();
        if (!in_array($prefix, self::getServerConfigurationPrefixes())) {
            return false;
        }
        $query = \OCP\DB::prepare('
			DELETE
			FROM `*PREFIX*appconfig`
			WHERE `configkey` LIKE ?
				AND `appid` = \'user_ldap\'
				AND `configkey` NOT IN (\'enabled\', \'installed_version\', \'types\', \'bgjUpdateGroupsLastRun\')
		');
        $delRows = $query->execute(array($prefix . '%'));
        if (\OCP\DB::isError($delRows)) {
            return false;
        }
        if ($delRows == 0) {
            return false;
        }
        return true;
    }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:28,代码来源:helper.php

示例4: isset

<?php

/**
 * ownCloud - Updater plugin
 *
 * @author Victor Dubiniuk
 * @copyright 2012-2013 Victor Dubiniuk victor.dubiniuk@gmail.com
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 */
namespace OCA\Updater;

\OCP\User::checkAdminUser();
\OCP\Util::addScript(App::APP_ID, '3rdparty/angular');
\OCP\Util::addScript(App::APP_ID, 'app');
\OCP\Util::addScript(App::APP_ID, 'controllers');
\OCP\Util::addStyle(App::APP_ID, 'updater');
if (!@file_exists(App::getBackupBase())) {
    Helper::mkdir(App::getBackupBase());
}
$data = App::getFeed();
$isNewVersionAvailable = isset($data['version']) && $data['version'] != '' && $data['version'] !== array();
$tmpl = new \OCP\Template(App::APP_ID, 'admin');
$lastCheck = \OC_Appconfig::getValue('core', 'lastupdatedat');
$tmpl->assign('checkedAt', \OCP\Util::formatDate($lastCheck));
$tmpl->assign('isNewVersionAvailable', $isNewVersionAvailable ? 'true' : 'false');
$tmpl->assign('channels', Channel::getChannels());
$tmpl->assign('currentChannel', Channel::getCurrentChannel());
$tmpl->assign('version', isset($data['versionstring']) ? $data['versionstring'] : '');
return $tmpl->fetchPage();
开发者ID:samj1912,项目名称:repo,代码行数:31,代码来源:admin.php


注:本文中的OCP\User::checkAdminUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。