コード例 #1
0
 private function getExpandInfo($uid = null)
 {
     $profile_group_list = $this->_profile_group_list($uid);
     if (!count($profile_group_list)) {
         redirect(U('Ucenter/member/step', array('step' => get_next_step('expand_info'))));
     }
     foreach ($profile_group_list as &$v) {
         $v['fields'] = $this->_info_list($v['id']);
     }
     $this->assign('profile_group_list', $profile_group_list);
 }
コード例 #2
0
 /**
  * 登录指定用户
  * @param  integer $uid 用户ID
  * @param bool $remember
  * @param int $role_id 有值代表强制登录这个角色
  * @return boolean      ture-登录成功,false-登录失败
  */
 public function login($uid, $remember = false, $role_id = 0)
 {
     /* 检测是否在当前应用注册 */
     $user = $this->field(true)->find($uid);
     if ($role_id != 0) {
         $user['last_login_role'] = $role_id;
     } else {
         if (!intval($user['last_login_role'])) {
             $user['last_login_role'] = $user['show_role'];
         }
     }
     session('temp_login_uid', $uid);
     session('temp_login_role_id', $user['last_login_role']);
     if ($user['status'] == 3) {
         header('Content-Type:application/json; charset=utf-8');
         $data['status'] = 1;
         $data['url'] = U('Ucenter/Member/activate');
         if (IS_AJAX) {
             exit(json_encode($data));
         } else {
             redirect($data['url']);
         }
     }
     if (1 != $user['status']) {
         $this->error = L('_USERS_ARE_NOT_ACTIVATED_OR_DISABLED_WITH_EXCLAMATION_');
         //应用级别禁用
         return false;
     }
     $step = M('UserRole')->where(array('uid' => $uid, 'role_id' => $user['last_login_role']))->getField('step');
     if (!empty($step) && $step != 'finish') {
         header('Content-Type:application/json; charset=utf-8');
         $data['status'] = 1;
         //执行步骤在start的时候执行下一步,否则执行此步骤
         $go = $step == 'start' ? get_next_step($step) : check_step($step);
         $data['url'] = U('Ucenter/Member/step', array('step' => $go));
         if (IS_AJAX) {
             exit(json_encode($data));
         } else {
             redirect($data['url']);
         }
     }
     /* 登录用户 */
     $this->autoLogin($user, $remember);
     session('temp_login_uid', null);
     session('temp_login_role_id', null);
     //记录行为
     action_log('user_login', 'member', $uid, $uid);
     return true;
 }
コード例 #3
0
 public function edit_expandinfo()
 {
     $result = A('Ucenter/RegStep', 'Widget')->edit_expandinfo();
     if ($result['status']) {
         $this->success('保存成功!', session('temp_login_uid') ? U('Ucenter/member/step', array('step' => get_next_step('expand_info'))) : 'refresh');
     } else {
         !isset($result['info']) && ($result['info'] = '没有要保存的信息!');
         $this->error($result['info']);
     }
 }
コード例 #4
0
 /**
  * 设置用户标签
  * @author 郑钟良<*****@*****.**>
  */
 public function set_tag()
 {
     $result = A('Ucenter/RegStep', 'Widget')->do_set_tag();
     if ($result['status']) {
         $result['url'] = U('Ucenter/member/step', array('step' => get_next_step('set_tag')));
     } else {
         !isset($result['info']) && ($result['info'] = '没有要保存的信息!');
     }
     $this->ajaxReturn($result);
 }
コード例 #5
0
ファイル: index.php プロジェクト: southern-wind/wind
installation_session();
ob_start();
/*
 * Step initialization and calculation
 */
$steps = array('welcome' => 'Platform installer', 'deps' => 'Dependencies', 'file_perms' => 'File permissions', 'community' => 'Community Information', 'smarty' => 'Smarty configuration', 'dbsetup' => 'Setup database', 'dbinit' => 'Initialize database', 'mapbounds' => 'Setup map boundaries', 'srtm' => 'Nasa SRTM data files', 'final' => 'Finish');
$step_keys = array_keys($steps);
if (!isset($_GET['step'])) {
    $_SESSION['step'] = $step_current = $step_keys[0];
} else {
    $step_current = !isset($_SESSION['step']) || !in_array($_SESSION['step'], $step_keys) ? $step_keys[0] : $_SESSION['step'];
    if ($_GET['step'] == get_next_step($steps, $step_current)) {
        $_SESSION['step'] = $step_current = get_next_step($steps, $step_current);
    }
}
$next_step = get_next_step($steps, $step_current);
$step_current_index = array_search($step_current, $step_keys);
?>
<!DOCTYPE html>
<html>
<head>
	<title>WiND - Installation</title>
	<link rel="stylesheet" href="<?php 
echo surl('/../templates/basic/css/styles_packed.css');
?>
" >
	<link rel="icon" type="image/png" href="<?php 
echo surl('/../templates/basic/images/favicon_32.png');
?>
" / >
	<link rel="stylesheet" href="install.css">