本文整理汇总了PHP中Kernel::isSuperAdmin方法的典型用法代码示例。如果您正苦于以下问题:PHP Kernel::isSuperAdmin方法的具体用法?PHP Kernel::isSuperAdmin怎么用?PHP Kernel::isSuperAdmin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kernel
的用法示例。
在下文中一共展示了Kernel::isSuperAdmin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: home
public function home()
{
if (!Kernel::isAdmin()) {
return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get()));
}
$tplHome = new CopixTpl();
$tpl = new CopixTpl();
$tpl->assign('TITLE_PAGE', CopixI18N::get('sysutils|admin.moduleDescription'));
$tpl->assign('MENU', Admin::getMenu('sysutils'));
$tplHome->assign('superadmin', Kernel::isSuperAdmin());
$tplHome->assign('adminfonctionnel', Kernel::isAdminFonctionnel());
$tpl->assign('MAIN', $tplHome->fetch('sysutils|home.tpl'));
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}
示例2: getMenu
/**
* Renvoie le menu de toutes les pages d'admin
*
* @author Christophe Beyer <cbeyer@cap-tic.fr>
* @since 2007/03/19
* @param string $iCurrentTab Onglet selectionne
* @return string Contenu du menu (liens...)
*/
public function getMenu($iCurrentTab = '')
{
$menu = array();
$menu[] = array('txt' => CopixI18N::get('sysutils|admin.shortDescription'), 'url' => CopixUrl::get('sysutils||'), 'current' => $iCurrentTab == 'sysutils');
$menu[] = array('txt' => CopixI18N::get('sysutils|admin.menu.cache'), 'url' => CopixUrl::get('sysutils|cache|'), 'current' => $iCurrentTab == 'cache');
$menu[] = array('txt' => CopixI18N::get('sysutils|admin.menu.stats'), 'url' => CopixUrl::get('sysutils|stats|'), 'current' => $iCurrentTab == 'stats');
if (Kernel::isSuperAdmin()) {
$menu[] = array('txt' => CopixI18N::get('sysutils|admin.menu.demo'), 'url' => CopixUrl::get('sysutils|demo|'), 'current' => $iCurrentTab == 'demo');
/*
$menu[] = array(
'txt' => CopixI18N::get ('sysutils|admin.menu.grvilles'),
'url' => CopixUrl::get ('sysutils|grvilles|')
);
*/
$menu[] = array('txt' => CopixI18N::get('sysutils|admin.menu.phpinfo'), 'url' => CopixUrl::get('sysutils|admin|phpinfo'), 'current' => $iCurrentTab == 'phpinfo');
}
$menu[] = array('txt' => CopixI18N::get('sysutils|admin.menu.groupes'), 'url' => CopixUrl::get('sysutils|groupes|'), 'current' => $iCurrentTab == 'groupes');
return $menu;
}
示例3: getUserExtMod
//.........这里部分代码省略.........
$userext_dao->update($userext_item);
if ($pPasswd1 != '' && $pPasswd1 == $pPasswd2) {
// Changer passwd
// dbuser : id_dbuser login_dbuser password_dbuser email_dbuser enabled_dbuser
// kernel_link_bu2user : user_id bu_type bu_id
$sql = "\n UPDATE dbuser\n JOIN kernel_link_bu2user\n ON dbuser.id_dbuser=kernel_link_bu2user.user_id\n SET dbuser.password_dbuser=md5(:passwd)\n WHERE kernel_link_bu2user.bu_type = 'USER_EXT'\n AND kernel_link_bu2user.bu_id = :id";
_doQuery($sql, array(':passwd' => $pPasswd1, ':id' => _request('id')));
}
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('comptes||getUserExt'));
}
break;
case 'ADD':
$tpl->assign('TITLE_PAGE', CopixI18N::get('comptes.moduleDescription') . " » " . CopixI18N::get('comptes.title.getuserextadd'));
$userext_item = CopixDAOFactory::createRecord("kernel|kernel_ext_user");
if ($pNom == '' && $pPrenom == '') {
$errors['ext_nom'] = CopixI18N::get('comptes.alert.nameempty');
$userext_item->ext_id = 0;
}
if (trim($pLogin) == '') {
$errors['login'] = CopixI18N::get('comptes.alert.loginempty');
} else {
$logins = _doQuery('SELECT * FROM dbuser WHERE login_dbuser=:login', array(':login' => $pLogin));
if (count($logins)) {
$errors['login'] = CopixI18N::get('comptes.alert.loginexists');
}
}
if ($pPasswd1 == '') {
$errors['passwd1'] = CopixI18N::get('comptes.alert.passwdempty');
}
if ($pPasswd1 != '' && $pPasswd1 != $pPasswd2) {
$errors['passwd2'] = CopixI18N::get('comptes.alert.passwddiff');
}
if (count($errors) == 0) {
// $userext_item->ext_id
$userext_item->ext_nom = $pNom;
$userext_item->ext_prenom = $pPrenom;
$userext_item->ext_description = '';
$userext_dao->insert($userext_item);
$copixuser_item = CopixDAOFactory::createRecord("kernel|kernel_copixuser");
$copixuser_item->login_dbuser = trim($pLogin);
$copixuser_item->password_dbuser = md5($pPasswd1);
$copixuser_item->email_dbuser = '';
$copixuser_item->enabled_dbuser = 1;
$copixuser_dao->insert($copixuser_item);
$bu2user_item = CopixDAOFactory::createRecord("kernel|kernel_bu2user2");
$bu2user_item->user_id = $copixuser_item->id_dbuser;
$bu2user_item->bu_type = "USER_EXT";
$bu2user_item->bu_id = $userext_item->ext_id;
$bu2user_dao->insert($bu2user_item);
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('comptes||getUserExt'));
}
break;
case 'DEL':
// die("Do Del");
$userext_item = $userext_dao->get(abs(_request('id')));
if ($userext_item) {
$userext_dao->delete(abs(_request('id')));
}
_doQuery('DELETE FROM dbuser, kernel_link_bu2user USING dbuser JOIN kernel_link_bu2user ON dbuser.id_dbuser=kernel_link_bu2user.user_id WHERE kernel_link_bu2user.bu_type="USER_EXT" AND kernel_link_bu2user.bu_id=:id', array(':id' => abs(_request('id'))));
// _doQuery('DELETE FROM kernel_link_bu2user WHERE kernel_link_bu2user.bu_type="USER_EXT" AND kernel_link_bu2user.bu_id=:id', array(':id'=>abs(_request('id'))));
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('comptes||getUserExt'));
break;
}
} else {
if (_request('id') > 0) {
$tpl->assign('TITLE_PAGE', CopixI18N::get('comptes.moduleDescription') . " » " . CopixI18N::get('comptes.title.getuserextmod'));
$userext_item = $userext_dao->get(_request('id'));
if (!$userext_item) {
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('comptes||getUserExt'));
}
if (!Kernel::isSuperAdmin() && Kernel::getLevel('ROOT', 0, "USER_EXT", $userext_item->ext_id) >= PROFILE_CCV_ADMIN) {
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('comptes||getUserExt'));
}
$mode = 'MOD';
} elseif (_request('id') < 0) {
$tpl->assign('TITLE_PAGE', CopixI18N::get('comptes.moduleDescription') . " » " . CopixI18N::get('comptes.title.getuserextdel'));
$userext_item = $userext_dao->get(abs(_request('id')));
if (!$userext_item) {
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('comptes||getUserExt'));
}
if (!Kernel::isSuperAdmin() && Kernel::getLevel('ROOT', 0, "USER_EXT", $userext_item->ext_id) >= PROFILE_CCV_ADMIN) {
return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('comptes||getUserExt'));
}
$mode = 'DEL';
} else {
$tpl->assign('TITLE_PAGE', CopixI18N::get('comptes.moduleDescription') . " » " . CopixI18N::get('comptes.title.getuserextadd'));
$userext_item = CopixDAOFactory::createRecord("kernel|kernel_ext_user");
$userext_item->ext_id = 0;
$mode = 'ADD';
}
}
if ($mode == 'ADD' || $mode == 'MOD') {
$result = CopixZone::process('comptes|getUserExtForm', array('user' => $userext_item, 'mode' => $mode, 'errors' => $errors));
} else {
return CopixActionGroup::process('genericTools|Messages::getConfirm', array('title' => CopixI18N::get('comptes.moduleDescription') . " » " . CopixI18N::get('comptes.title.getuserextdel'), 'message' => CopixI18N::get('comptes.alert.getuserextdel', trim($userext_item->ext_prenom . ' ' . $userext_item->ext_nom)), 'confirm' => CopixUrl::get('comptes|default|getUserExtMod', array('id' => _request('id'), 'mode' => 'DEL')), 'cancel' => CopixUrl::get('comptes|default|getUserExt')));
}
$tpl->assign('MAIN', $result);
$tpl->assign('MENU', $this->menu);
return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl);
}