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

PHP unsetServerSessionId函数代码示例

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

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



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

示例1: create_session

function create_session($user_name, $password, $version)
{
    global $log, $adb;
    require_once 'modules/Users/Users.php';
    include 'config/version.php';
    /* Make 5.0.4 plugins compatible with 5.1.0 */
    if (version_compare($version, '5.0.4', '>=') === 1) {
        return array("VERSION", '00');
    }
    $return_access = array("FALSES", '00');
    $objuser = new Users();
    if ($password != "") {
        $objuser->column_fields['user_name'] = $user_name;
        $objuser->load_user($password);
        if ($objuser->is_authenticated()) {
            $userid = $objuser->retrieve_user_id($user_name);
            $sessionid = makeRandomPassword();
            unsetServerSessionId($userid);
            $sql = "insert into vtiger_soapservice values(?,?,?)";
            $result = $adb->pquery($sql, array($userid, 'Office', $sessionid));
            $return_access = array("TRUE", $sessionid);
        } else {
            $return_access = array("FALSE", '00');
        }
    } else {
        //$server->setError("Invalid username and/or password");
        $return_access = array("LOGIN", '00');
    }
    $objuser = $objuser;
    return $return_access;
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:31,代码来源:wordplugin.php


示例2: authenticate_user

/**	function used to authenticate whether the customer has access or not
 *	@param string $username - customer name for the customer portal
 *	@param string $password - password for the customer portal
 *	@param string $login - true or false. If true means function has been called for login process and we have to clear the session if any, false means not called during login and we should not unset the previous sessions
 *	return array $list - returns array with all the customer details
 */
function authenticate_user($username, $password, $version, $login = 'true')
{
    global $adb, $log;
    $adb->println("Inside customer portal function authenticate_user({$username}, {$password}, {$login}).");
    include 'vtigerversion.php';
    if (version_compare($version, '5.1.0', '>=') == 0) {
        $list[0] = "NOT COMPATIBLE";
        return $list;
    }
    $username = $adb->sql_escape_string($username);
    $password = $adb->sql_escape_string($password);
    $current_date = date("Y-m-d");
    $sql = "select id, user_name, user_password,last_login_time, support_start_date, support_end_date\n\t\t\t\tfrom vtiger_portalinfo\n\t\t\t\t\tinner join vtiger_customerdetails on vtiger_portalinfo.id=vtiger_customerdetails.customerid\n\t\t\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_portalinfo.id\n\t\t\t\twhere vtiger_crmentity.deleted=0 and user_name=? and user_password = ?\n\t\t\t\t\tand isactive=1 and vtiger_customerdetails.portal=1\n\t\t\t\t\tand vtiger_customerdetails.support_start_date <= ? and vtiger_customerdetails.support_end_date >= ?";
    $result = $adb->pquery($sql, array($username, $password, $current_date, $current_date));
    $err[0]['err1'] = "MORE_THAN_ONE_USER";
    $err[1]['err1'] = "INVALID_USERNAME_OR_PASSWORD";
    $num_rows = $adb->num_rows($result);
    if ($num_rows > 1) {
        return $err[0];
    } elseif ($num_rows <= 0) {
        return $err[1];
    }
    //No user
    $customerid = $adb->query_result($result, 0, 'id');
    $list[0]['id'] = $customerid;
    $list[0]['user_name'] = $adb->query_result($result, 0, 'user_name');
    $list[0]['user_password'] = $adb->query_result($result, 0, 'user_password');
    $list[0]['last_login_time'] = $adb->query_result($result, 0, 'last_login_time');
    $list[0]['support_start_date'] = $adb->query_result($result, 0, 'support_start_date');
    $list[0]['support_end_date'] = $adb->query_result($result, 0, 'support_end_date');
    //During login process we will pass the value true. Other times (change password) we will pass false
    if ($login != 'false') {
        $sessionid = makeRandomPassword();
        unsetServerSessionId($customerid);
        $sql = "insert into vtiger_soapservice values(?,?,?)";
        $result = $adb->pquery($sql, array($customerid, 'customer', $sessionid));
        $list[0]['sessionid'] = $sessionid;
    }
    return $list;
}
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:46,代码来源:customerportal.php


示例3: authenticate_user

/**	function used to authenticate whether the customer has access or not
 *	@param string $username - customer name for the customer portal
 *	@param string $password - password for the customer portal
 *	@param string $login - true or false. If true means function has been called for login process and we have to clear the session if any, false means not called during login and we should not unset the previous sessions
 *	return array $list - returns array with all the customer details
 */
function authenticate_user($username, $password, $version, $portalLang, $login = 'true')
{
    $adb = vglobal('adb');
    $log = vglobal('log');
    $currentLanguage = vglobal('current_language');
    $adb->println("Inside customer portal function authenticate_user({$username}, {$password}, {$login}).");
    include 'config/version.php';
    if (version_compare($version, $YetiForce_current_version, '>=') == 0) {
        $list[0] = "NOT COMPATIBLE";
        return $list;
    }
    $password = CustomerPortalPassword::encryptPassword($password, $username);
    $currentDate = date("Y-m-d");
    $sql = "select id, user_name, user_password,last_login_time, support_start_date, support_end_date\n\t\t\t\tfrom vtiger_portalinfo\n\t\t\t\t\tinner join vtiger_customerdetails on vtiger_portalinfo.id=vtiger_customerdetails.customerid\n\t\t\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_portalinfo.id\n\t\t\t\twhere vtiger_crmentity.deleted=0 and user_name=? and user_password = ?\n\t\t\t\t\tand isactive=1 and vtiger_customerdetails.portal=1\n\t\t\t\t\tand vtiger_customerdetails.support_start_date <= ? and vtiger_customerdetails.support_end_date >= ?";
    $result = $adb->pquery($sql, array($username, $password, $currentDate, $currentDate));
    $num_rows = $adb->num_rows($result);
    if ($num_rows > 1) {
        return array('err1' => "LBL_MORE_THAN_ONE_USER");
    } elseif ($num_rows <= 0) {
        return array('err1' => "LBL_INVALID_USERNAME_OR_PASSWORD");
    }
    //No user
    $customerid = $adb->query_result($result, 0, 'id');
    $list[0]['id'] = $customerid;
    $list[0]['user_name'] = $adb->query_result($result, 0, 'user_name');
    $list[0]['user_password'] = $adb->query_result($result, 0, 'user_password');
    $list[0]['last_login_time'] = $adb->query_result($result, 0, 'last_login_time');
    $list[0]['support_start_date'] = $adb->query_result($result, 0, 'support_start_date');
    $list[0]['support_end_date'] = $adb->query_result($result, 0, 'support_end_date');
    $currentLanguage = $portalLang;
    vglobal('default_language', $currentLanguage);
    //During login process we will pass the value true. Other times (change password) we will pass false
    if ($login != 'false') {
        $sessionid = makeRandomPassword();
        unsetServerSessionId($customerid);
        $sql = "insert into vtiger_soapservice values(?,?,?,?)";
        $result = $adb->pquery($sql, array($customerid, 'customer', $sessionid, $portalLang));
        $list[0]['sessionid'] = $sessionid;
    }
    update_login_details($customerid, $sessionid, 'login');
    return $list;
}
开发者ID:JeRRimix,项目名称:YetiForceCRM,代码行数:48,代码来源:yetiportal.php


示例4: LogintoVtigerCRM

function LogintoVtigerCRM($user_name, $password, $version)
{
    global $log, $adb;
    require_once 'modules/Users/Users.php';
    include 'vtigerversion.php';
    if ($version != $vtiger_current_version) {
        return array("VERSION", '00');
    }
    $return_access = array("FALSES", '00');
    $objuser = new Users();
    if ($password != "") {
        $objuser->column_fields['user_name'] = $user_name;
        $objuser->load_user($password);
        if ($objuser->is_authenticated()) {
            $userid = $objuser->retrieve_user_id($user_name);
            $sessionid = makeRandomPassword();
            unsetServerSessionId($userid);
            $sql = "insert into vtiger_soapservice values(?,?,?)";
            $result = $adb->pquery($sql, array($userid, 'FireFox', $sessionid));
            $return_access = array("TRUES", $sessionid);
        } else {
            $return_access = array("FALSES", '00');
        }
    } else {
        //$server->setError("Invalid username and/or password");
        $return_access = array("FALSES", '00');
    }
    $objuser = $objuser;
    return $return_access;
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:30,代码来源:firefoxtoolbar.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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