• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_user_module_list函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: check_modules_access

 function check_modules_access($user, $module_name, $action = 'write')
 {
     if (!isset($_SESSION['avail_modules'])) {
         $_SESSION['avail_modules'] = get_user_module_list($user);
     }
     if (isset($_SESSION['avail_modules'][$module_name])) {
         if ($action == 'write' && $_SESSION['avail_modules'][$module_name] == 'read_only') {
             if (is_admin($user)) {
                 return true;
             }
             return false;
         } elseif ($action == 'write' && strcmp(strtolower($module_name), 'users') == 0 && !$user->isAdminForModule($module_name)) {
             //rrs bug: 46000 - If the client is trying to write to the Users module and is not an admin then we need to stop them
             return false;
         }
         return true;
     }
     return false;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:19,代码来源:SugarWebServiceUtilv4_1.php


示例2: login

/**
 * Log the user into the application
 *
 * @param UserAuth array $user_auth -- Set user_name and password (password needs to be 
 *      in the right encoding for the type of authentication the user is setup for.  For Base 
 *      sugar validation, password is the MD5 sum of the plain text password.
 * @param String $application -- The name of the application you are logging in from.  (Currently unused).
 * @return Array(session_id, error) -- session_id is the id of the session that was 
 *      created.  Error is set if there was any error during creation.
 */
function login($user_auth, $application)
{
    $error = new SoapError();
    $user = new User();
    $user = $user->retrieve_by_string_fields(array('user_name' => $user_auth['user_name'], 'user_hash' => $user_auth['password'], 'deleted' => 0, 'status' => 'Active', 'portal_only' => 0));
    if (!empty($user) && !empty($user->id)) {
        session_start();
        global $current_user;
        $current_user = $user;
        $user->loadPreferences();
        $_SESSION['is_valid_session'] = true;
        $_SESSION['ip_address'] = $_SERVER['REMOTE_ADDR'];
        $_SESSION['user_id'] = $user->id;
        $_SESSION['type'] = 'user';
        $_SESSION['avail_modules'] = get_user_module_list($user);
        login_success();
        return array('id' => session_id(), 'error' => $error);
    }
    $error->set_error('invalid_login');
    return array('id' => -1, 'error' => $error);
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:SoapSugarUsers.php


示例3: login

/**
 * Log the user into the application
 *
 * @param UserAuth array $user_auth -- Set user_name and password (password needs to be
 *      in the right encoding for the type of authentication the user is setup for.  For Base
 *      sugar validation, password is the MD5 sum of the plain text password.
 * @param String $application -- The name of the application you are logging in from.  (Currently unused).
 * @return Array(session_id, error) -- session_id is the id of the session that was
 *      created.  Error is set if there was any error during creation.
 */
function login($user_auth, $application)
{
    global $sugar_config, $system_config;
    $error = new SoapError();
    $user = new User();
    $success = false;
    //rrs
    $system_config = new Administration();
    $system_config->retrieveSettings('system');
    $authController = new AuthenticationController(!empty($sugar_config['authenticationClass']) ? $sugar_config['authenticationClass'] : 'SugarAuthenticate');
    //rrs
    $isLoginSuccess = $authController->login($user_auth['user_name'], $user_auth['password'], array('passwordEncrypted' => true));
    $usr_id = $user->retrieve_user_id($user_auth['user_name']);
    if ($usr_id) {
        $user->retrieve($usr_id);
    }
    if ($isLoginSuccess) {
        if ($_SESSION['hasExpiredPassword'] == '1') {
            $error->set_error('password_expired');
            $GLOBALS['log']->fatal('password expired for user ' . $user_auth['user_name']);
            LogicHook::initialize();
            $GLOBALS['logic_hook']->call_custom_logic('Users', 'login_failed');
            return array('id' => -1, 'error' => $error);
        }
        // if
        if (!empty($user) && !empty($user->id) && !$user->is_group) {
            $success = true;
            global $current_user;
            $current_user = $user;
        }
        // if
    } else {
        if ($usr_id && isset($user->user_name) && $user->getPreference('lockout') == '1') {
            $error->set_error('lockout_reached');
            $GLOBALS['log']->fatal('Lockout reached for user ' . $user_auth['user_name']);
            LogicHook::initialize();
            $GLOBALS['logic_hook']->call_custom_logic('Users', 'login_failed');
            return array('id' => -1, 'error' => $error);
        } else {
            if (function_exists('mcrypt_cbc')) {
                $password = decrypt_string($user_auth['password']);
                $authController = new AuthenticationController(!empty($sugar_config['authenticationClass']) ? $sugar_config['authenticationClass'] : 'SugarAuthenticate');
                if ($authController->login($user_auth['user_name'], $password) && isset($_SESSION['authenticated_user_id'])) {
                    $success = true;
                }
                // if
            }
        }
    }
    // else if
    if ($success) {
        session_start();
        global $current_user;
        //$current_user = $user;
        login_success();
        $current_user->loadPreferences();
        $_SESSION['is_valid_session'] = true;
        $_SESSION['ip_address'] = query_client_ip();
        $_SESSION['user_id'] = $current_user->id;
        $_SESSION['type'] = 'user';
        $_SESSION['avail_modules'] = get_user_module_list($current_user);
        $_SESSION['authenticated_user_id'] = $current_user->id;
        $_SESSION['unique_key'] = $sugar_config['unique_key'];
        $current_user->call_custom_logic('after_login');
        return array('id' => session_id(), 'error' => $error);
    }
    $error->set_error('invalid_login');
    $GLOBALS['log']->fatal('SECURITY: User authentication for ' . $user_auth['user_name'] . ' failed');
    LogicHook::initialize();
    $GLOBALS['logic_hook']->call_custom_logic('Users', 'login_failed');
    return array('id' => -1, 'error' => $error);
}
开发者ID:sunmo,项目名称:snowlotus,代码行数:82,代码来源:SoapSugarUsers.php


示例4: check_modules_access

function check_modules_access($user, $module_name, $action = 'write')
{
    if (!isset($_SESSION['avail_modules'])) {
        $_SESSION['avail_modules'] = get_user_module_list($user);
    }
    if (isset($_SESSION['avail_modules'][$module_name])) {
        if ($action == 'write' && $_SESSION['avail_modules'][$module_name] == 'read_only') {
            if (is_admin($user)) {
                return true;
            }
            return false;
        }
        return true;
    }
    return false;
}
开发者ID:nartnik,项目名称:sugarcrm_test,代码行数:16,代码来源:SoapHelperFunctions.php


示例5: login

/**
 * Log the user into the application
 *
 * @param UserAuth array $user_auth -- Set user_name and password (password needs to be
 *      in the right encoding for the type of authentication the user is setup for.  For Base
 *      sugar validation, password is the MD5 sum of the plain text password.
 * @param String $application -- The name of the application you are logging in from.  (Currently unused).
 * @return Array(session_id, error) -- session_id is the id of the session that was
 *      created.  Error is set if there was any error during creation.
 */
function login($user_auth, $application)
{
    global $sugar_config, $system_config;
    $error = new SoapError();
    $user = new User();
    $success = false;
    //rrs
    $system_config = new Administration();
    $system_config->retrieveSettings('system');
    $authController = new AuthenticationController(!empty($sugar_config['authenticationClass']) ? $sugar_config['authenticationClass'] : 'SugarAuthenticate');
    //rrs
    $user = $user->retrieve_by_string_fields(array('user_name' => $user_auth['user_name'], 'user_hash' => $user_auth['password'], 'deleted' => 0, 'status' => 'Active', 'portal_only' => 0));
    if (!empty($user) && !empty($user->id) && !$user->is_group) {
        $success = true;
        global $current_user;
        $current_user = $user;
    } else {
        if (function_exists('mcrypt_cbc')) {
            $password = decrypt_string($user_auth['password']);
            if ($authController->login($user_auth['user_name'], $password) && isset($_SESSION['authenticated_user_id'])) {
                $success = true;
            }
        }
    }
    if ($success) {
        session_start();
        global $current_user;
        //$current_user = $user;
        login_success();
        $current_user->loadPreferences();
        $_SESSION['is_valid_session'] = true;
        $_SESSION['ip_address'] = query_client_ip();
        $_SESSION['user_id'] = $current_user->id;
        $_SESSION['type'] = 'user';
        $_SESSION['avail_modules'] = get_user_module_list($current_user);
        $_SESSION['authenticated_user_id'] = $current_user->id;
        $_SESSION['unique_key'] = $sugar_config['unique_key'];
        $current_user->call_custom_logic('after_login');
        return array('id' => session_id(), 'error' => $error);
    }
    $error->set_error('invalid_login');
    $GLOBALS['log']->fatal('SECURITY: User authentication for ' . $user_auth['user_name'] . ' failed');
    LogicHook::initialize();
    $GLOBALS['logic_hook']->call_custom_logic('Users', 'login_failed');
    return array('id' => -1, 'error' => $error);
}
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:56,代码来源:SoapSugarUsers.php


示例6: check_modules_access

 function check_modules_access($user, $module_name, $action = 'write')
 {
     $GLOBALS['log']->info('Begin: SoapHelperWebServices->check_modules_access');
     if (!isset($_SESSION['avail_modules'])) {
         $_SESSION['avail_modules'] = get_user_module_list($user);
     }
     if (isset($_SESSION['avail_modules'][$module_name])) {
         if ($action == 'write' && $_SESSION['avail_modules'][$module_name] == 'read_only') {
             if (is_admin($user)) {
                 $GLOBALS['log']->info('End: SoapHelperWebServices->check_modules_access');
                 return true;
             }
             // if
             $GLOBALS['log']->info('End: SoapHelperWebServices->check_modules_access');
             return false;
         }
         $GLOBALS['log']->info('End: SoapHelperWebServices->check_modules_access');
         return true;
     }
     $GLOBALS['log']->info('End: SoapHelperWebServices->check_modules_access');
     return false;
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:22,代码来源:SoapHelperWebService.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_user_name函数代码示例发布时间:2022-05-15
下一篇:
PHP get_user_meta函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap