Пример #1
0
if (!defined('ICMS_ROOT_PATH')) {
    exit;
}
icms_loadLanguageFile('core', 'user');
$uname = !isset($_POST['uname']) ? '' : trim($_POST['uname']);
$pass = !isset($_POST['pass']) ? '' : trim($_POST['pass']);
/**
 * Commented out for OpenID , we need to change it to make a better validation if OpenID is used
 */
/*if ($uname == '' || $pass == '') {
 redirect_header(ICMS_URL.'/user.php', 1, _US_INCORRECTLOGIN);
 exit();
 }*/
$member_handler = icms::handler('icms_member');
icms_loadLanguageFile('core', 'auth');
$icmsAuth =& icms_auth_Factory::getAuthConnection(icms_core_DataFilter::addSlashes($uname));
// uname&email hack GIJ
$uname4sql = addslashes(icms_core_DataFilter::stripSlashesGPC($uname));
$pass4sql = addslashes(icms_core_DataFilter::stripSlashesGPC($pass));
/*if (strstr( $uname , '@' )) {
 // check by email if uname includes '@'
 $criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('email', $uname4sql ));
 $criteria->add(new icms_db_criteria_Item('pass', $pass4sql));
 $user_handler = icms::handler('icms_member_user');
 $users =& $user_handler->getObjects($criteria, false);
 if (empty( $users ) || count( $users ) != 1 ) $user = false ;
 else $user = $users[0] ;
 unset( $users ) ;
 } */
if (empty($user) || !is_object($user)) {
    $user =& $icmsAuth->authenticate($uname4sql, $pass4sql);
Пример #2
0
 public function &getAuthConnection($uname)
 {
     parent::getAuthConnection($uname);
     $this->_deprecated = icms_core_Debug::setDeprecated('icms_auth_Factory', sprintf(_CORE_REMOVE_IN_VERSION, '1.4'));
 }
Пример #3
0
 * @author		malanciault <*****@*****.**>
 * @version		SVN: $Id: finish_auth.php 21731 2011-06-10 21:36:28Z skenow $
 */
/**
 * Set this to TRUE to troubleshoot OpenID login
 */
$openid_debug = FALSE;
define('ICMS_INCLUDE_OPENID', TRUE);
$xoopsOption['pagetype'] = 'user';
/** Including mainfile.php is required */
include_once 'mainfile.php';
$redirect_url = $_SESSION['frompage'];
$member_handler = icms::handler('icms_member');
/** Including the language files for the authentication pages */
icms_loadLanguageFile('core', 'auth');
$xoopsAuth =& icms_auth_Factory::getAuthConnection(NULL);
$user = $xoopsAuth->authenticate($openid_debug);
if ($xoopsAuth->errorOccured()) {
    redirect_header($redirect_url, 3, $xoopsAuth->getHtmlErrors());
}
switch ($xoopsAuth->step) {
    case OPENID_STEP_NO_USER_FOUND:
        $xoopsOption['template_main'] = 'system_openid.html';
        /** Including header.php to start page rendering */
        include_once ICMS_ROOT_PATH . "/header.php";
        $sreg = $_SESSION['openid_sreg'];
        $xoopsTpl->assign('displayId', $xoopsAuth->displayid);
        $xoopsTpl->assign('cid', $xoopsAuth->openid);
        $xoopsTpl->assign('uname', isset($sreg['nickname']) ? $sreg['nickname'] : '');
        $xoopsTpl->assign('email', isset($sreg['email']) ? $sreg['email'] : '');
        /** Including footer.php to complete page rendering */