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


PHP getRole函数代码示例

本文整理汇总了PHP中getRole函数的典型用法代码示例。如果您正苦于以下问题:PHP getRole函数的具体用法?PHP getRole怎么用?PHP getRole使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: set

 public function set()
 {
     daocall('setting', 'add', array('view_dir', $_REQUEST['view_dir']));
     daocall('setting', 'add', array('reg_user_price', $_REQUEST['reg_user_price'] * 100));
     daocall('setting', 'add', array('reg_off', $_REQUEST['reg_off']));
     daocall('setting', 'add', array('findpasswd_off', $_REQUEST['findpasswd_off']));
     daocall('setting', 'add', array('try_day', $_REQUEST['try_day']));
     if ($_REQUEST['view_dir'] != $this->setting['view_dir']) {
         $log = array('operate_object' => 'view_dir=' . $_REQUEST['view_dir'], 'admin' => getRole('admin'), 'operate' => $_REQUEST['c'] . "&a=" . $_REQUEST['a']);
         apicall('operatelog', 'operatelogAdd', array($log));
     }
     if ($_REQUEST['reg_user_price'] * 100 != $this->setting['reg_user_price']) {
         $log = array('operate_object' => 'reg_user_price=' . $_REQUEST['reg_user_price'], 'admin' => getRole('admin'), 'operate' => $_REQUEST['c'] . "&a=" . $_REQUEST['a']);
         apicall('operatelog', 'operatelogAdd', array($log));
     }
     if ($_REQUEST['reg_off'] != $this->setting['reg_off']) {
         $log = array('operate_object' => 'reg_off=' . $_REQUEST['reg_off'], 'admin' => getRole('admin'), 'operate' => $_REQUEST['c'] . "&a=" . $_REQUEST['a']);
         apicall('operatelog', 'operatelogAdd', array($log));
     }
     if ($_REQUEST['findpasswd_off'] != $this->setting['findpasswd_off']) {
         $log = array('operate_object' => 'findpasswd_off=' . $_REQUEST['findpasswd_off'], 'admin' => getRole('admin'), 'operate' => $_REQUEST['c'] . "&a=" . $_REQUEST['a']);
         apicall('operatelog', 'operatelogAdd', array($log));
     }
     return header('Location: ?c=function&a=setFrom');
 }
开发者ID:srdc2014,项目名称:vhms,代码行数:25,代码来源:function.ctl.php

示例2: index

 public function index()
 {
     if (isset($_SESSION[C('USER_AUTH_KEY')])) {
         //显示菜单项
         $menu = array();
         $model = M("AdminMenu");
         if (session("administrator")) {
             //echo 'dd';
         } else {
             //echo 'bb';
             $uid = getMemberId();
             $role = getRole($uid);
             //继续。。
             //获取用户
         }
         $list = $model->where('display=1')->order(array('fid' => 'asc', 'sort' => 'asc'))->select();
         $menu = fetchMenu($list, 0);
         $menu_html = displayMenu($menu, false);
         $this->assign('menu', $menu_html);
     }
     C('SHOW_RUN_TIME', false);
     // 运行时间显示
     C('SHOW_PAGE_TRACE', false);
     $this->display();
 }
开发者ID:yunsite,项目名称:nuomituan,代码行数:25,代码来源:IndexAction.class.php

示例3: login

function login($ip, $nick, $password)
{
    /*$intentos = 0;
    		if (isset($_COOKIE['intentos'])){ 
    			$intentos = $_COOKIE['intentos'];
    		}
    				
    		if ($intentos <= 3){*/
    $hashedPassword = hash("sha256", $password, false);
    if (checkNickPassword($nick, $hashedPassword)) {
        $email = getEmail($nick);
        $_SESSION['nick'] = $nick;
        $_SESSION['email'] = $email;
        $_SESSION['role'] = getRole($email);
        //setcookie( 'intentos', 0, time() + 1800 ); //30 minutos
        addAction($nick, $email, $ip, 'logged_in');
        addConnection($nick, $email, $ip);
        return '0';
        // Logged.
    } else {
        //if ($intentos < 3) {
        //setcookie( 'intentos', $intentos + 1, time() + 1800 ); //30 minutos
        return '1';
        // Log in failed.
    }
    /*} 
    		
    		setcookie( 'intentos', 0, time() + 1800);
    		return '2';	// Superado el límite de intentos.
    		*/
}
开发者ID:jagumiel,项目名称:bigou-Album,代码行数:31,代码来源:user_logic.php

示例4: getListByQuery

 function getListByQuery($query, $department, $rtype = '')
 {
     $sDeptCondition = '';
     $sCondition = '';
     $sYear = getSchoolYear($this);
     if (getRole($this) == 2) {
         $sDept = $this->mod->getDeptOfEmployee(getUserId($this));
         $sDept = $sDept[0]->department_id;
         $sDeptCondition = "employees.department_id = {$sDept} and";
     }
     $sDeptCondition = '';
     $rCondition = '';
     if (getRole($this) != 2 && ($department != -1 && !empty($department))) {
         $sDeptCondition = "(employees.department_id = {$department}) and";
     }
     if (!empty($query)) {
         $sCondition = "(employees.empno like '%{$query}%' or employees.fname like '%{$query}%' or employees.lname like '%{$query}%') and";
     }
     $iProfileId = getUserId($this);
     if (getRole($this) == 2) {
         $sdep = $this->mod->getDeptOfEmployee($iProfileId);
         $sDeptCondition = "(employees.department_id = {$sdep[0]->department_id}) and ";
     }
     if (!empty($rtype)) {
         if (strpos($rtype, 'nal') !== false) {
             $rCondition = "and if(emp_types.time_unit = 'd', \r\n\r\n                    (select (sum(abs(datediff(g.end_date, g.start_date)) - abs(g.end_date_hw + g.start_date_hw)) +1)\r\n                        from \r\n                            leave_transactions g, leave_credits \r\n                        where \r\n\r\n                            employment_id = employment.id and \r\n                            leave_credits.id = leave_credits_id and \r\n                                                        leave_credits.is_base = 1 and g.schoolyear = '{$sYear}'),\r\n\r\n\r\n\r\n\r\n                    round((        select (sum(timediff(g.end_time,g.start_time)))/10000 from \r\n                            leave_transactions g \r\n                        where \r\n\r\n                            g.employment_id = employment.id and g.schoolyear = '{$sYear}'\r\n\r\n                    ),2)) is null";
         }
     }
     $query = $this->db->query("\r\n            select \r\n                employees.id as myid, \r\n                employment.*, \r\n                employees.*,\r\n                ranks.*,\r\n                roles.*,\r\n                departments.*,\r\n                emp_types.*,\r\n                status.*,\r\n                emp_types.time_unit as timeunit\r\n            from \r\n                employment, \r\n                emp_types, \r\n                status, \r\n                employees, \r\n                emp_types_stat,\r\n                ranks,\r\n                departments,\r\n                roles\r\n            where \r\n                ({$sCondition} {$sDeptCondition} \r\n                employment.emp_types_stat_id = emp_types_stat.id and\r\n                \r\n                emp_types.id = emp_types_stat.emp_types_id and \r\n                \r\n                status.id = emp_types_stat.status_id and \r\n                \r\n                employment.employee_id = employees.id and\r\n                \r\n                employees.rank_id = ranks.id and\r\n                \r\n                employees.department_id = departments.id and\r\n                \r\n                employees.role_id = roles.id) {$rCondition} \r\n\r\n                group by employees.department_id, lname, fname\r\n                ");
     if ($query->num_rows() > 0) {
         return $query->result();
     } else {
         return "";
     }
 }
开发者ID:acelumaad,项目名称:leave-system,代码行数:35,代码来源:employment_model.php

示例5: getQueryList

 function getQueryList($sEmployeeId = '', $sDept = '', $sStat = '', $rType = '')
 {
     $sCondition = '';
     $sDeptCondition = '';
     $sStatCondition = '';
     $sRtype = '';
     if (!empty($sEmployeeId)) {
         $sCondition = "and e.id = {$sEmployeeId}";
     }
     if (!empty($sStat) && strpos($sStat, "All") === false) {
         $sStatCondition = "and g.status = '{$sStat}'";
     }
     if (!empty($sDept) && $sDept != -1) {
         $sDeptCondition = "and e.department_id = {$sDept}";
     }
     if (!empty($rType)) {
         $sRtype = '';
     }
     $iProfileId = getUserId($this);
     if (getRole($this) == 2) {
         $sdep = $this->mod->getDeptOfEmployee($iProfileId);
         $sDeptCondition = "and (e.department_id = {$sdep[0]->department_id})";
     } else {
         if (getRole($this) == 3) {
             $sDeptCondition = "and (e.id = {$iProfileId})";
         }
     }
     $query = $this->db->query("\r\n                select \r\n                    g.*,\r\n                    concat(e.fname,' ',e.lname) as employee,\r\n                    datediff(g.end_date, g.start_date) as leaves                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              \r\n                from \r\n                    leave_transactions g, \r\n                    employees e,\r\n                    employment em \r\n                where (g.employment_id = em.id and em.employee_id = e.id) \r\n                    {$sCondition} \r\n                    {$sStatCondition} \r\n                    {$sDeptCondition}\r\n                order by g.filing_date desc");
     $aResult = $query->result();
     return $query->result();
 }
开发者ID:acelumaad,项目名称:leave-system,代码行数:31,代码来源:leave_transactions_model.php

示例6: adminOnly

function adminOnly($role)
{
    // Redirect all if not admin.
    if (getRole() < 3) {
        header('Location: /');
        exit;
    }
}
开发者ID:Braatan,项目名称:Engrave,代码行数:8,代码来源:functions.php

示例7: del

 public function del()
 {
     $ret = daocall('admin_user', 'delUser', array($_REQUEST['username']));
     if ($ret) {
         $log = array('admin' => getRole('admin'), 'operate' => $_REQUEST['a'], 'operate_object' => 'username=' . $_REQUEST['username']);
         apicall('operatelog', 'operatelogAdd', array($log));
     }
     header("Location: ?c=adminuser&a=listUser");
 }
开发者ID:srdc2014,项目名称:vhms,代码行数:9,代码来源:adminuser.ctl.php

示例8: verificaRespostaCriterio

 public function verificaRespostaCriterio($enterpriseId, $perguntaId, $competitionId)
 {
     $configDb = Zend_Registry::get('configDb');
     $query = $this->select()->setIntegrityCheck(false)->from(array('CHEKEV' => 'CheckerEvaluation'))->join(array('CHEKente' => 'CheckerEnterprise'), 'CHEKEV.CheckerEnterpriseId = CHEKente.ID', NULL)->where('CHEKente.EnterpriseId = ?', $enterpriseId)->where('CHEKEV.QuestionCheckerId = ?', $perguntaId);
     $query->reset(Zend_Db_Select::COLUMNS)->columns(array('CHEKEV.QuestionCheckerId', 'CHEKEV.Resposta'));
     $objResult = getRole($this->fetchRow($query));
     $resposta = array();
     $resposta[$objResult['QuestionCheckerId']] = $objResult['Resposta'];
     return $resposta;
 }
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:10,代码来源:ApeEvaluationVerificador.php

示例9: manPayReturn

 /**
  * 用户充值成功,但没有到账,管理员手动给用户确认到账
  * Enter description here ...
  */
 public function manPayReturn()
 {
     if (apicall('money', 'payReturn', array($_REQUEST['id']))) {
         $this->_tpl->assign('msg', '充值成功');
         $log = array('operate_object' => 'id=' . $_REQUEST['id'], 'admin' => getRole('admin'), 'operate' => $_REQUEST['a']);
         apicall('operatelog', 'operatelogAdd', array($log));
     } else {
         $this->_tpl->assign('msg', '充值失败');
     }
     return $this->display('msg.html');
 }
开发者ID:srdc2014,项目名称:vhms,代码行数:15,代码来源:money.ctl.php

示例10: delMproductorder

 public function delMproductorder()
 {
     $result = daocall('mproductorder', 'del', array(intval($_REQUEST['id'])));
     if (!$result) {
         $this->_tpl->assign('msg', '删除失败');
         return $this->_tpl->fetch('msg.html');
     }
     $log = array('operate_object' => 'id=' . $_REQUEST['id'], 'admin' => getRole('admin'), 'operate' => $_REQUEST['a']);
     apicall('operatelog', 'operatelogAdd', array($log));
     return $this->pageListMproductorder();
 }
开发者ID:srdc2014,项目名称:vhms,代码行数:11,代码来源:mproductorder.ctl.php

示例11: delAgent

 public function delAgent()
 {
     if (!daocall('agent', 'del', array($_REQUEST['id']))) {
         $this->_tpl->assign('msg', "删除失败");
         return $this->_tpl->fetch('msg.html');
     }
     $log = array('operate_object' => 'id=' . $_REQUEST['id'], 'admin' => getRole('admin'), 'operate' => $_REQUEST['a']);
     apicall('operatelog', 'operatelogAdd', array($log));
     daocall('user', 'updateUserAgent_idByAent_id', array($_REQUEST['id']));
     daocall('agentprice', 'delAgentpriceByAgent_id', array($_REQUEST['id']));
     return $this->listAgent();
 }
开发者ID:srdc2014,项目名称:vhms,代码行数:12,代码来源:agent.ctl.php

示例12: login

 public function login()
 {
     $user = $this->checkPassword($_REQUEST['username'], $_REQUEST['passwd']);
     if (!$user) {
         return $this->_tpl->display('login_error.html');
         //die('登录错误![<a href="javascript:history.go(-1);">返回</a>]');
     }
     registerRole('admin', $user['username']);
     $_SESSION['admin_last_login'] = $user['last_login'];
     $_SESSION['admin_last_ip'] = $user['last_ip'];
     $log = array('operate_object' => 'username=' . $_REQUEST['username'], 'mem' => 'ip=' . $_SERVER["REMOTE_ADDR"], 'admin' => getRole('admin'), 'operate' => $_REQUEST['c'] . "&a=" . $_REQUEST['a']);
     apicall('operatelog', 'operatelogAdd', array($log));
     header("Location: index.php");
 }
开发者ID:srdc2014,项目名称:vhms,代码行数:14,代码来源:session.ctl.php

示例13: showMyProposalPage

function showMyProposalPage()
{
    //TODO check for the role of current user
    $role = getRole();
    if (!Users::isStudent()) {
        echo t('You can only see this page as a student');
        return;
    }
    //Get my groups
    $my_proposals = Proposal::getInstance()->getMyProposals();
    //::getGroups(_ORGANISATION_GROUP);
    if (!$my_proposals) {
        echo t('You have no proposal at the moment.') . '<br/>';
        echo "<a href='" . _WEB_URL . "/projects/browse'>" . t('Please find yourself a project') . "</a>.";
    } else {
        $current_tab = getRequestVar('new_tab', 0);
        showMyProposals($my_proposals, $current_tab);
    }
}
开发者ID:edwinraycom,项目名称:vals-soc,代码行数:19,代码来源:proposals.php

示例14: getSysadmin

 public function getSysadmin()
 {
     $c = new Criteria();
     $users = UserPeer::doSelect($c);
     foreach ($users as $user1) {
         $userrole = $user1->getUserRoles();
         $found = false;
         foreach ($userroles as $userrole) {
             if ($userrole . getRole()->getName() == 'sysadmin') {
                 $found = true;
                 break;
             }
         }
         if (found == true) {
             return $user1;
         }
     }
     return null;
 }
开发者ID:Ayaan123,项目名称:alumnisangam,代码行数:19,代码来源:UserPeer.php

示例15: moneyout

 public function moneyout()
 {
     $page = intval($_REQUEST['page']);
     if ($page <= 0) {
         $page = 1;
     }
     $page_count = 15;
     $count = 0;
     $list = daocall('moneyout', 'pageByUser', array(getRole('user'), $page, $page_count, &$count));
     $total_page = ceil($count / $page_count);
     if ($page >= $total_page) {
         $page = $total_page;
     }
     $this->_tpl->assign('count', $count);
     $this->_tpl->assign('total_page', $total_page);
     $this->_tpl->assign('page', $page);
     $this->_tpl->assign('page_count', $page_count);
     $this->_tpl->assign('list', $list);
     return $this->_tpl->fetch('money/moneyout.html');
 }
开发者ID:srdc2014,项目名称:vhms,代码行数:20,代码来源:money.ctl.php


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