Ejemplo n.º 1
0
 /**
  * 自动登录用户
  * @param  integer $user 用户信息数组
  */
 private function autoLogin($user, $remember = false)
 {
     /* 更新登录信息 */
     $data = array('uid' => $user['uid'], 'login' => array('exp', '`login`+1'), 'last_login_time' => NOW_TIME, 'last_login_ip' => get_client_ip(1));
     $this->save($data);
     /* 记录登录SESSION和COOKIES */
     $auth = array('uid' => $user['uid'], 'username' => get_username($user['uid']), 'last_login_time' => $user['last_login_time']);
     session('user_auth', $auth);
     session('user_auth_sign', data_auth_sign($auth));
     if ($remember) {
         $token = build_auth_key();
         $user1 = D('user_token')->where('uid=' . $user['uid'])->find();
         $data1['token'] = $token;
         $data1['time'] = time();
         if ($user1 == null) {
             $data1['uid'] = $user['uid'];
             D('user_token')->add($data1);
         } else {
             D('user_token')->where('uid=' . $user['uid'])->save($data1);
         }
     }
     if (!$this->getCookieUid() && $remember) {
         $expire = 3600 * 24 * 7;
         cookie('ZS_LOGGED_USER', $this->jiami($this->change() . ".{$user['uid']}.{$token}"), $expire);
     }
 }
Ejemplo n.º 2
0
 /**
  * 用户登录认证
  * @param  string  $username 用户名
  * @param  string  $password 用户密码
  * @param  integer $type     用户名类型 (1-用户名,2-邮箱,3-手机,4-UID)
  * @return integer           登录成功-用户ID,登录失败-错误编号
  */
 public function login($username, $password, $type = 1)
 {
     if (file_exists('./api/uc_login.lock')) {
         include_once './api/uc_client/client.php';
         if (strtolower(UC_CHARSET) == 'gbk') {
             $username = iconv('UTF-8', 'GBK', $username);
         }
         $uc_user = uc_user_login($username, $password, 0);
         if ($uc_user[0] == -2) {
             return '密码错误';
         } elseif ($uc_user[0] == -1) {
             return '用户不存在,或者被删除';
         } elseif ($uc_user[0] > 0) {
             if (strtolower(UC_CHARSET) == 'gbk') {
                 $uc_user[1] = iconv('GBK', 'UTF-8', $uc_user[1]);
             }
             D('member')->where(array('uid' => $uc_user[0]))->setField('nickname', $uc_user[1]);
             D('ucenter_member')->where(array('id' => $uc_user[0]))->setField('username', $uc_user[1]);
             return $uc_user[0];
         }
     } else {
         if (UC_SYNC && $username != get_username(1)) {
             return $this->ucLogin($username, $password);
         }
         return $this->model->login($username, $password, $type);
     }
 }
Ejemplo n.º 3
0
function get_status_list($target = null)
{
    $states = array();
    $result = '';
    $target = isset($target) ? $target : get_username();
    // Default to showing own status.
    $statuses = getStatus($target);
    $health = getHealth($target);
    if ($health < 1) {
        $states[] = "Dead";
    } else {
        // *** Other statuses only display if not dead.
        if ($health < 80) {
            $states[] = "Injured";
        } else {
            $states[] = "Healthy";
        }
        if ($statuses['Stealth']) {
            $states[] = "Stealthed";
        }
        if ($statuses['Poison']) {
            $states[] = "Poisoned";
        }
        if ($statuses['Frozen']) {
            $states[] = "Frozen";
        }
    }
    return $states;
}
Ejemplo n.º 4
0
 function index()
 {
     $this->load->model('twitter_model');
     if (get_username() == $this->config->item('default_user')) {
         /*
         			$this->load->library('postmark');
         			$query = $this->db->query("SELECT username, email FROM user");
         			foreach ($query->result() as $row) {
         				$this->postmark->clear();
         				$this->postmark->from('*****@*****.**', 'Stephen Ou');
         				$this->postmark->to($row->email);
         				$this->postmark->subject('Some updates from OneExtraLap HQ');
         				$this->postmark->message_html('Hello, there,<br /><br />Sorry to bug you, but I have some great things to tell you. :)<br /><br />First, I released some really cool features earlier this week, including view grades, edit tags, and more. Also our landing page has a featured user list. If you want to be stood out, participate as much as possible! More info: http://oneextralap.tumblr.com/post/965814476<br /><br />Second, I want to give you the privilege to invite friends to the site, your invite link is http://oneextralap.com/refer/'.$row->username.'. There are awards for it too, 3 new users = Promotion Ambassador badge!<br /><br />Lastly, I made a handy survey.io feedback form for your guys, because I want to know your opinions about OneExtraLap and help us grow together! http://survey.io/survey/99b06<br /><br />Stephen,<br />Founder of OneExtraLap<br />http://oneextralap.com');
         				$this->postmark->send();
         				echo $row->email.' '.$row->code.'<br />';
         			}
         			$query = $this->db->query("SELECT answer_id FROM activity");
         			foreach ($query->result() as $row) {
         				$row1 = $this->db->query("SELECT question_id FROM answer WHERE id='$row->answer_id'")->row();
         				
         				$this->db->update('activity', array('question_id' => $row1->question_id), array('answer_id' => $row->answer_id));
         			}
         			$query = $this->db->query("SELECT username FROM user");
         			foreach ($query->result() as $row) {
         				$this->db->update('user', array('notification' => 1), array('username' => $username));
         			}
         			$query = $this->db->query("SELECT username FROM user WHERE avatar='http://www.gravatar.com/avatar'");
         			foreach ($query->result() as $row) {
         				$this->db->update('user', array('avatar' => 'http://www.gravatar.com/avatar/'), array('username' => $username));
         			}
         			$query = $this->db->query("SELECT username FROM user WHERE twitter!=''");
         			foreach ($query->result() as $row) {
         				$this->db->update('user', array('share_created' => 1, 'share_badge' => 1), array('username' => $username));
         			}
         $quiz = array('netspencer', 'stephenou', 'danielbru', 'hiten', 'crystalcy', 'imkevinxu', 'zacharycollins', 'markbao', 'powdahound', 'jp', 'andmurphoto', 'jakemates', 'mike3k');
         			$a = 0;
         			while ($a < count($quiz)) {
         				$this->db->insert('preset', array('content' => $quiz[$a], 'type' => 'people'));
         				$a++;
         			}
         		
         			
         			$query = $this->db->query("SELECT username, twitter, twitter_id FROM user WHERE twitter!='' AND twitter_id=0");
         			foreach ($query->result() as $row) {
         				$call = $this->twitter->call('users/show', array('screen_name' => $row->twitter));
         				$this->db->update('user', array('twitter_id' => $call->id), array('username' => $username));
         			}
         			
         			$query = $this->db->query("SELECT username FROM user");
         			foreach ($query->result() as $row) {
         				$this->badge_model->check($row->username, 'test');
         			}
         */
         /*
          */
     } else {
         stupid();
     }
 }
Ejemplo n.º 5
0
function get_selected_courses()
{
    $student = get_username();
    $courses = get_option($student . "_selected_courses");
    if (!$courses) {
        $courses = array();
    }
    return $courses;
}
Ejemplo n.º 6
0
function get_user()
{
    $CI =& get_instance();
    $username = get_username();
    if (!$username) {
        return FALSE;
    }
    return $CI->db->get_where('agent', array('name' => $username))->row_array();
}
Ejemplo n.º 7
0
function users_restricted() {
  ssl_required();
  if( array_search(get_username(), AllowedUsers::$list) === False ) {
    // user not allowed to view this page
    // redirect to another page saying as much
    header('Location: ../error-page/?code=forbidden');
    die(0);
  }  
}
Ejemplo n.º 8
0
function make_content($row)
{
    global $tp;
    $contents = utf8_decode(stripslashes($tp->toHTML($row['page_content'], true, 'body')));
    include_once "Textile.php";
    $textile = new Textile();
    $contents = $textile->process($contents);
    return $contents . "<p><small>" . LAN_W_8 . " <a href='" . e_HTTP . "user.php?id." . $row['page_author'] . "'>" . get_username($row['page_author']) . "</a></small></p>";
}
Ejemplo n.º 9
0
 public function lists()
 {
     $list = $this->item->select();
     foreach ($list as $k => $v) {
         $list[$k]['username'] = get_username($v['uid']);
         $list[$k]['itemtype'] = $this->itemCate->where(array('id' => $v['itemtype']))->getField('catename');
     }
     $this->list = $list;
     $this->display();
 }
Ejemplo n.º 10
0
 /**
  * 自动登录用户
  * @param  integer $user 用户信息数组
  */
 private function autoLogin($user)
 {
     /* 更新登录信息 */
     $data = array('uid' => $user['uid'], 'login' => array('exp', '`login`+1'), 'last_login_time' => NOW_TIME, 'last_login_ip' => get_client_ip(1));
     $this->save($data);
     /* 记录登录SESSION和COOKIES */
     $auth = array('uid' => $user['uid'], 'username' => get_username($user['uid']), 'last_login_time' => $user['last_login_time']);
     session('user_auth', $auth);
     session('user_auth_sign', data_auth_sign($auth));
 }
Ejemplo n.º 11
0
 function get_session_username($session_id)
 {
     $session_id = preg_replace('/\\W/', '', $session_id);
     $user_id = Token::is_valid($session_id);
     if (!empty($user_id)) {
         return get_username($user_id);
     } else {
         return null;
     }
 }
Ejemplo n.º 12
0
/**
 * create_banlist()
 *
 * @return
 **/
function create_banlist()
{
    global $CONFIG, $lang_banning_php, $album_date_fmt;
    //$PHP_SELF,
    $result = cpg_db_query("SELECT *, UNIX_TIMESTAMP(expiry) AS expiry FROM {$CONFIG['TABLE_BANNED']} WHERE brute_force=0");
    $count = mysql_num_rows($result);
    if ($count > 0) {
        echo <<<EOHEAD
                <tr>
                <th align="center" class="tableh2">{$lang_banning_php['user_name']}</th>
                <th align="center" class="tableh2">{$lang_banning_php['ip_address']}</th>
                <th align="center" class="tableh2">{$lang_banning_php['expiry']}</th>
                <th align="center" class="tableh2"></th>
                </tr>
EOHEAD;
        $row_counter = 0;
        while ($row = mysql_fetch_array($result)) {
            if ($row['user_id']) {
                $username = get_username($row['user_id']);
            } else {
                $username = '';
            }
            if ($row['expiry']) {
                $expiry = localised_date($row['expiry'], '%Y-%m-%d');
            } else {
                $expiry = '';
            }
            echo <<<EOROW
                                        <tr>
                                               <form action="{$_SERVER['PHP_SELF']}" method="post" name="banlist{$row_counter}">
                                                     <td width="20%" class="tableb" valign="middle">
                                                             <input type="hidden" name="ban_id" value="{$row['ban_id']}" />
                                                <input type="text" class="textinput" style="width: 100%" name="edit_ban_user_name" value="{$username}" />
                                        </td>
                                                <td class="tableb" valign="middle">
                                                <input type="text" class="textinput" size="15" name="edit_ban_ip_addr" value="{$row['ip_addr']}" />
                                        </td>
                                                <td class="tableb" valign="middle">
                                                <input type="text" class="listbox_lang" size="20" name="edit_ban_expires" value="{$expiry}" readonly="readonly" title="{$lang_banning_php['select_date']}" />
                                                <a href="javascript:;"  onclick="return getCalendar(document.banlist{$row_counter}.edit_ban_expires);" title="{$lang_banning_php['select_date']}"><img src="images/calendar.gif" width="16" height="16" border="0" alt="" /></a>
                                        </td>
                                        <td class="tableb" valign="middle">
                                                                <input type="submit" class="button" name="edit_ban" value="{$lang_banning_php['edit_ban']}" />
                                        &nbsp;&nbsp;
                                                                <input type="submit" class="button" name="delete_ban" value="{$lang_banning_php['delete_ban']}" />
                                        </td>
                                </form>
                                </tr>
EOROW;
            $row_counter++;
        }
    }
    mysql_free_result($result);
}
Ejemplo n.º 13
0
 /**
  * 自动登录用户
  * @param  integer $user 用户信息数组
  */
 private function autoLogin($user)
 {
     /* 更新登录信息 */
     $data = array("uid" => $user["uid"], "login" => array("exp", "`login`+1"), "last_login_time" => NOW_TIME, "last_login_ip" => get_client_ip(1));
     $this->save($data);
     /* 记录登录SESSION和COOKIES */
     $auth = array("uid" => $user["uid"], "username" => get_username($user["uid"]), "last_login_time" => $user["last_login_time"]);
     session("user_auth", $auth);
     session("uid", $auth["uid"]);
     session("user_auth_sign", data_auth_sign($auth));
 }
Ejemplo n.º 14
0
 public function index()
 {
     if (!is_login()) {
         $this->error("您还没有登陆", U("User/login"));
     }
     $uid = is_login();
     $address = M("address");
     $list = $address->where("uid='{$uid}'")->select();
     $this->assign('list', $list);
     $this->meta_title = get_username() . '的地址管理';
     $this->display();
 }
Ejemplo n.º 15
0
 public function article()
 {
     $Blogs = D('Article');
     $blog = $Blogs->where(array('status' => 1))->getField('id,title,description,create_time,uid');
     $RssConf = array('channelTitle' => 'zswin社交类博客', 'channelLink' => 'http://zswin.cn', 'channelDescrīption' => 'zswin开源博客', 'copyright' => 'zswin');
     $RSS = new Rss($RssConf);
     foreach ($blog as $k => $v) {
         $RSS->AddItem($v['title'], CSU('/artc/' . $v['id'], 'Index/artc', array('id' => $v['id'])), $v['description'], toDate($v['create_time']), $v['id'], get_username($v['uid']));
     }
     $RSS->SaveToFile("./rss.xml");
     echo $RSS->Show();
 }
Ejemplo n.º 16
0
 function profile_anchor($user_id, $user_name = '', $params = array())
 {
     if (!$user_name) {
         $user_name = get_username($user_id);
     }
     $user_name = trim($user_name);
     if ($user_id != 0) {
         return "<a href=\"profile.php?uid={$user_id}\" " . html::params($params) . ">{$user_name}</a>" . PHP_EOL;
     } else {
         return $user_name;
     }
 }
Ejemplo n.º 17
0
function create_banlist()
{
    global $CONFIG, $PHP_SELF, $lang_banning_php, $album_date_fmt;
    $result = db_query("SELECT * FROM {$CONFIG['TABLE_BANNED']}");
    $count = mysql_num_rows($result);
    if ($count > 0) {
        echo <<<EOHEAD
                <tr>
                <th align="center" class="tableh2">{$lang_banning_php['user_name']}</th>
                <th align="center" class="tableh2">{$lang_banning_php['ip_address']}</th>
                <th align="center" class="tableh2">{$lang_banning_php['expiry']}</th>
                <th align="center" class="tableh2"></th>
                </tr>
EOHEAD;
        $row_counter = 0;
        while ($row = mysql_fetch_array($result)) {
            if ($row['user_id']) {
                $username = get_username($row['user_id']);
            } else {
                $username = '';
            }
            if ($row['expiry']) {
                $expiry = $row['expiry'];
            } else {
                $expiry = '';
            }
            echo <<<EOROW
                                        <tr>
                                               <form action="{$PHP_SELF}" method="post" name="banlist{$row_counter}">
                                                     <td width="20%" class="tableb" valign="middle">
                                                             <input type="hidden" name="ban_id" value="{$row['ban_id']}">
                                                <input type="text" class="textinput" style="width: 100%" name="edit_ban_user_name" value="{$username}">
                                        </td>
                                                <td class="tableb" valign="middle">
                                                <input type="text" class="textinput" size="15" name="edit_ban_ip_addr" value="{$row['ip_addr']}">
                                        </td>
                                                <td class="tableb" valign="middle">
                                                <input type="text" class="listbox_lang" size="20" name="edit_ban_expires" value="{$expiry}" readonly="readonly" onclick="return getCalendar(document.banlist{$row_counter}.edit_ban_expires);" style="cursor:pointer" title="select date" />
                                        </td>
                                        <td class="tableb" valign="middle">
                                                                <input type="submit" class="button" name="edit_ban" value="{$lang_banning_php['edit_ban']}">
                                        &nbsp;&nbsp;
                                                                <input type="submit" class="button" name="delete_ban" value="{$lang_banning_php['delete_ban']}">
                                        </td>
                                </form>
                                </tr>
EOROW;
            $row_counter++;
        }
    }
    mysql_free_result($result);
}
Ejemplo n.º 18
0
 public function index()
 {
     if (!is_login()) {
         $this->error("您还没有登陆", U("User/login"));
     }
     $uid = is_login();
     $faceid = D('UcenterMember')->getfaceid($uid);
     $this->assign('faceid', $faceid);
     $lists = M("Member")->where("uid='{$uid}'")->select();
     $this->meta_title = get_username() . '个人中心';
     $this->assign('information', $lists);
     $this->display();
 }
Ejemplo n.º 19
0
 /**
  * Check whether the player has the skill.
  **/
 function hasSkill($skill, $username = null)
 {
     $skill = strtolower($skill);
     if (!$username) {
         $username = get_username();
     }
     $skills = $this->skills($username);
     if (isset($skills[$skill])) {
         return true;
         // The player has those skills.
     }
     return false;
 }
Ejemplo n.º 20
0
 /**
  * 自动登录用户
  * @param  integer $user 用户信息数组
  */
 private function autoLogin($user, $remember = true)
 {
     /* 更新登录信息 */
     $data = array('uid' => $user['uid'], 'login' => array('exp', '`login`+1'), 'last_login_time' => NOW_TIME, 'last_login_ip' => get_client_ip(1));
     $this->save($data);
     /* 记录登录SESSION和COOKIES */
     $auth = array('uid' => $user['uid'], 'username' => get_username($user['uid']), 'last_login_time' => $user['last_login_time']);
     session('user_auth', $auth);
     session('user_auth_sign', data_auth_sign($auth));
     if (!$this->getCookieUid() && $remember) {
         $expire = 3600 * 24 * 7;
         cookie('QTV1_LOGGED_USER', $this->jiami($this->change() . ".{$user['uid']}"), $expire);
     }
 }
Ejemplo n.º 21
0
 function index()
 {
     $vars = array();
     $authorizer = check_model::getInstance();
     $vars['nagavitor'] = $this->forum->get_nagavitor();
     $vars['cat_id'] = $this->validate->get->getInt('id');
     if ($vars['cat_id']) {
         if (!$authorizer->is_cat_id($vars['cat_id'])) {
             cpg_die(ERROR, Lang::item('error.wrong_cat_id'), __FILE__, __LINE__);
         }
     }
     $vars['user_posts'] = $this->forum->get_user_post_count();
     $vars['last_visit'] = $this->forum->get_last_visit_time();
     $cats = $this->forum->get_category($vars['cat_id'], 'cat_id, name');
     $vars['categories'] = array();
     foreach ($cats as $cat) {
         $newcat = array();
         $newcat['name'] = $cat['name'];
         $newcat['id'] = $cat['cat_id'];
         $boards = $this->forum->get_first_level_board($cat['cat_id'], 'board_id,name,description,last_msg_id,topics,posts,child_level');
         $newcat['boards'] = array();
         foreach ($boards as $board) {
             $last_message = $this->forum->get_message_data($board['last_msg_id'], 'subject, poster_id, poster_time');
             $newboard = array();
             $newboard['icon'] = 'plugins/forum/forum/html/images/icon_board_new.gif';
             $newboard['id'] = $board['board_id'];
             $newboard['name'] = $board['name'];
             $newboard['description'] = $board['description'];
             $newboard['last_post_id'] = $board['last_msg_id'];
             $newboard['last_post_title'] = $last_message['subject'];
             $newboard['last_post_time'] = $last_message['poster_time'];
             $newboard['last_post_author_id'] = $last_message['poster_id'];
             $newboard['last_post_author_name'] = get_username($last_message['poster_id']);
             $newboard['topics'] = $board['topics'];
             $newboard['replies'] = $board['posts'];
             $newboard['childs'] = $this->forum->get_child_board($board['board_id'], $board['child_level'], 'board_id, name');
             $newcat['boards'][] = $newboard;
             unset($newboard);
         }
         $vars['categories'][] = $newcat;
         unset($newcat);
     }
     $recents = $this->forum->get_latest_message();
     $vars['recents'] = $recents;
     $vars['stats'] = $this->forum->get_statistics();
     $vars['newest_members'] = $this->forum->get_latest_user();
     $vars['active_members'] = $this->forum->get_active_user();
     $this->view->render('home/index', $vars);
 }
Ejemplo n.º 22
0
 /**
  * Constructor
  *
  * Sets up the parameters for a attack legal check.
  * @param    mixed $attacker_info The attacker info, an object or else an id.
  * @param    mixed $target_info The target info, an object or an id.
  * @param    array $conditions The further conditions of the attack.
  * @access public
  */
 function __construct($attacker_name_or_id = null, $target_name_or_id, $params = array())
 {
     $this->attacker = null;
     $this->target = null;
     $this->params = $params;
     $this->error = null;
     if ($attacker_name_or_id) {
         $this->attacker = new Player($attacker_name_or_id);
     } elseif ($username = get_username()) {
         $this->attacker = new Player($username);
     }
     if ($target_name_or_id) {
         $this->target = new Player($target_name_or_id);
     }
 }
 public function show_user_avatar($eventname, $search_item)
 {
     if ($search_item->type === "user") {
         $search_item->avatar = Avatar::getAvatar($search_item->entry_id)->getURL(Avatar::MEDIUM);
         $user = new User($search_item->entry_id);
         $search_item->presentation = "<cite>" . htmlReady($user->motto) . "</cite>";
         $search_item->presentation .= "<div>" . htmlReady($user->schwerp) . "</div>";
         $uname = get_username($search_item->entry_id);
         $search_item->tools[] = '<a href="' . URLHelper::getLink("sms_send.php", array('rec_uname' => $uname)) . '" title="' . _("Nachricht schreiben") . '">' . Assets::img("icons/16/blue/mail.png", array('class' => "text-bottom")) . "</a>";
         if ($GLOBALS['perm']->have_perm("root")) {
             $search_item->tools[] = '<a href="' . URLHelper::getLink("dispatch.php/admin/user/edit/" . $search_item->entry_id) . '" title="' . _("Benutzerverwaltung") . '">' . Assets::img("icons/16/blue/edit.png", array('class' => "text-bottom")) . "</a>";
         } else {
             $search_item->tools[] = '<a href="' . URLHelper::getLink("about.php", array('username' => $uname, 'cmd' => "add_user", 'add_uname' => $uname)) . '" title="' . _("Als Buddy hinzufügen") . '">' . Assets::img("icons/16/blue/add/person.png", array('class' => "text-bottom")) . "</a>";
         }
     }
 }
Ejemplo n.º 24
0
/**
 * Delete an array of ids or all mail for a certain user.
**/
function delete_mail($ids, $all = false)
{
    $sql = new DBAccess();
    $deleted = 0;
    $username = get_username();
    if ($all) {
        // Delete all a user's mail.
        $del = "DELETE from mail where send_to='" . $username . "'";
    } else {
        // Delete an id list.
        $del = "DELETE from mail where send_to='" . $username . "'\n            AND id in ('" . implode("', '", $ids) . "')";
    }
    $sql->Delete($del);
    $deleted = $sql->a_rows;
    return $deleted;
}
Ejemplo n.º 25
0
function message_to_clan($message)
{
    global $sql;
    $error = null;
    $user_id = get_user_id();
    $username = get_username();
    $clan = getClan($username);
    $sql->Query("SELECT player_id, uname from players where clan = '" . sql($clan) . "'");
    $clan_members = $sql->fetchAll();
    $messaged_to = '';
    $comma = '';
    foreach ($clan_members as $loop_member) {
        send_message($user_id, $loop_member['player_id'], "CLAN: " . $message);
        $messaged_to .= $comma . $loop_member['uname'];
        $comma = ', ';
    }
    return $messaged_to;
}
Ejemplo n.º 26
0
function cert_info()
{
    $user = get_username();
    global $conf;
    $dir = $conf['PROXY_DIR'];
    $userpath = "{$dir}/{$user}";
    $certpath = "{$userpath}/usercert.pem";
    $info1 = get_cert_info_subject($certpath, $debug = false);
    $info2 = get_cert_info_valid($certpath, $debug = false);
    $info = array_merge($info1, $info2);
    //dd($info);
    $subject = $info['subject'];
    //$_SESSION['subject'] = $subject;
    print <<<EOS
Certificate: {$subject}

EOS;
}
Ejemplo n.º 27
0
 public function index()
 {
     if (!is_login()) {
         $this->error("您还没有登陆", U("User/login"));
     }
     $uid = is_login();
     //自动发货
     $this->auto_express($uid);
     $this->assign('uid', $uid);
     /* 数据分页*/
     $map['uid'] = $uid;
     $map['total'] = array('gt', 0);
     $list = D("order")->getLists($map);
     $this->assign('list', $list);
     // 赋值数据集
     $page = D("order")->getPage($map);
     $this->assign('page', $page);
     //
     $faceid = D('UcenterMember')->getfaceid($uid);
     $this->assign('faceid', $faceid);
     /*优惠券数量*/
     $num = M("UserCoupon")->where("uid='{$uid}'")->count();
     $this->assign('num', $num);
     /*购物车中数量*/
     $shopnum = M("shopcart")->where("uid='{$uid}'")->count();
     $this->assign('shopnum', $shopnum);
     /*待支付*/
     $onum = M("order")->where("uid='{$uid}' and status='-1' and ispay='1'")->count();
     $this->assign('onum', $onum);
     /*待发货*/
     $dnum = M("order")->where("uid='{$uid}' and status='1'")->count();
     $this->assign('dnum', $dnum);
     /*待确认*/
     $cnum = M("order")->where("uid='{$uid}' and status='2'")->count();
     $this->assign('cnum', $cnum);
     /*最后一次登录时间*/
     $time = M("member")->where("uid='{$uid}'")->limit(1)->find();
     $this->assign('time', $time);
     //站内信数量
     $ecount = D("UserEnvelope")->getNum($uid);
     $this->assign('ecount', $ecount);
     $this->meta_title = get_username() . '的个人中心';
     $this->display();
 }
Ejemplo n.º 28
0
 public function approve_action($plugin_id)
 {
     $this->marketplugin = new MarketPlugin($plugin_id);
     if ($this->marketplugin['approved']) {
         throw new Exception("Plugin ist schon reviewt.");
     }
     $this->marketplugin['approved'] = (int) Request::int("approved");
     if (!$this->marketplugin['approved']) {
         $this->marketplugin['publiclyvisible'] = 0;
     }
     if ($this->marketplugin['approved'] && $this->marketplugin['publiclyvisible']) {
         $this->marketplugin['published'] = time();
     }
     $this->marketplugin->store();
     $messaging = new messaging();
     $messaging->insert_message(sprintf(_("Ihr Plugin %s wurde reviewt:"), $this->marketplugin['name']) . "\n\n" . ($this->marketplugin['approved'] ? _("Es ist in den Marktplatz aufgenommen worden!") : _("Es ist leider noch nicht in den Marktplatz aufgenommen.")) . "\n\n" . (Request::get("review") ? _("Begründung:") . "\n\n" . Request::get("review") : _("Ein ausführliches Review wurde nicht angegeben und muss bei Bedarf direkt angefragt werden.")), get_username($this->marketplugin['user_id']), '', '', '', '', '', _("Pluginreview"), true, 'normal', "pluginreview");
     PageLayout::postMessage(MessageBox::success(_("Review wurde gespeichert.")));
     $this->redirect('approving/overview');
 }
Ejemplo n.º 29
0
function _read_file($file, $type)
{
    $tname = $file['tmp_name'];
    $cont = file_get_contents($tname);
    $user = get_username();
    global $conf;
    $dir = $conf['PROXY_DIR'];
    $userpath = "{$dir}/{$user}";
    @mkdir($userpath);
    if ($type == 'cert') {
        $path = "{$userpath}/usercert.pem";
    } else {
        if ($type == 'key') {
            $path = "{$userpath}/userkey.pem";
        }
    }
    rename($tname, $path);
    return $cont;
}
Ejemplo n.º 30
0
 public function view_index()
 {
     F('order');
     //引入function方法
     $CompetencePAList = get_userplatacountpower(get_userid());
     //获取登陆人的平台账号权限
     $ebayAccountList = array();
     //定义该登陆人在ebay平台上的可见账号数组
     foreach ($CompetencePAList as $value) {
         $ebayAccountList = $CompetencePAList[1];
     }
     $this->smarty->assign('ebayAccountList', $ebayAccountList);
     $this->smarty->assign('toplevel', A('Topmenu')->act_getToplevel('ExportExcelOutput'));
     $this->smarty->assign('secondlevel', A('Topmenu')->act_getSecondlevel('ExportExcelOutput'));
     $this->smarty->assign('toptitle', '报表导出');
     $this->smarty->assign('curusername', get_username());
     //SESSION['userName']
     $this->smarty->display('exportExcelOutput.htm');
 }