예제 #1
0
 function user_intergration($username, $pwd)
 {
     global $_lang;
     if ($this->_sys_config['user_intergration'] == 2) {
         require_once S_ROOT . '/uc_client/client.php';
         $uc_info = uc_user_login($username, $pwd);
         if ($uc_info['0'] > 0) {
             $u = array('uid' => $uc_info['0'], 'username' => $uc_info['1'], 'email' => $uc_info['3']);
         } else {
             $u = $uc_info['0'];
         }
     }
     if ($u == -2) {
         $this->show_msg($_lang['you_input_password_not_right'], 3);
     } elseif ($u == -1) {
         $this->show_msg($_lang['you_input_username_not_exist'], 4);
     } else {
         $exists = db_factory::get_count(sprintf(" select uid from %switkey_member where uid='%d' ", TABLEPRE, $u['uid']));
         if (!$exists) {
             $reg_obj = new keke_register_class();
             $reg_obj->_reg_pwd = md5($pwd);
             $reg_obj->save_userinfo($u['username'], $u['email'], $u['uid']);
         }
     }
     return $u;
 }