public function login()
 {
     if (Session::get(C('USER_AUTH_KEY'))) {
         $this->redirect('', 'home');
     } else {
         if (isset($_POST['login'])) {
             if (C('TOKEN_ON') && isset($_POST[C('TOKEN_NAME')])) {
                 $secure_code = $_POST[C('TOKEN_NAME')];
             } else {
                 $secure_code = '';
             }
             $email = isset($_POST['email']) ? $_POST['email'] : '';
             $password = isset($_POST['pass']) ? $secure_code . $_POST['pass'] : '';
             $autosignin = isset($_POST['persistent']) ? true : false;
             import('ORG.Text.Validation');
             $isEmail = I('Validation')->check($email, 'email');
             if (!$isEmail) {
                 $this->assign('error', L('login_invalid_email'));
             } else {
                 $map['email'] = $email;
                 $userDao = D('User');
                 $user = $userDao->find($map, '*');
                 if (!$user) {
                     $this->assign('error', L('login_incorrect_email'));
                 } else {
                     if ($secure_code . $user['password'] == md5($password)) {
                         Session::set(C('USER_AUTH_KEY'), $user['id']);
                         Session::set('userInfo', $user);
                         //get friends
                         $userFriend = getFriend($user['id']);
                         foreach ($userFriend as &$key) {
                             $key = current(array_diff($key, array($user['id'])));
                         }
                         Session::set('userFriend', $userFriend);
                         $userDao->setField('update_time', time(), 'id=' . $user['id']);
                         if ($autosignin) {
                             Cookie::set('signinId', $email, C('COOKIE_EXPIRE'));
                             Cookie::set('password', $password, C('COOKIE_EXPIRE'));
                         }
                         $this->redirect('', 'home');
                     } else {
                         $this->assign('error', L('signin_incorrect_password'));
                     }
                 }
             }
         }
         $this->display();
     }
 }
Esempio n. 2
0
function getNameType($wroot, $wid, $wname, $wmail, $nameicon, $nametype, $namelink)
{
    global $root, $bbs, $DB_CONNECT, $v_LogId, $table;
    if (!$bbs) {
        $bbs[NameIcon] = $nameicon;
        $bbs[NameType] = $nametype;
        $bbs[NameLink] = $namelink;
    }
    $Default_Icon = "<img src='../../member/icon/kimsdefaulticon.gif' align=absmiddle border=0 width=20 width=20>";
    $Root_Icon = $root[icon] ? "<img src='" . $root[icon] . "' align=absmiddle border=0 width=20 width=20>" : '';
    if ($wroot) {
        $NameSet = array($root[nic], $root[nic], 'root', $root[nic] . "(root)", $root[nic] . "(root)");
        $Esc_Name = $bbs[NameIcon] ? $Root_Icon . $NameSet[$bbs[NameType]] : $NameSet[$bbs[NameType]];
        $LinkType1 = "<a style='cursor:pointer' onclick=\"getRootLayer('" . $table . "',event);\">" . $Esc_Name . "</a>";
        $LinkType2 = "<a href='mailto:" . $root[email] . "'>" . $Esc_Name . "</a>";
        $LinkType3 = $Esc_Name;
        $LinkSet = array($LinkType1, $LinkType2, $LinkType3);
        return $v_LogId ? $LinkSet[$bbs[NameLink]] : $LinkSet[2];
    }
    if ($wid) {
        $M = getMemberLog($wid, 0, $DB_CONNECT);
        if ($M[MB_UID]) {
            $friendtype = getFriend($M[MB_ID]);
            $NameSet = array($M[MB_NAME], $M[MB_NIC], $M[MB_ID], $M[MB_NAME] . "(" . $M[MB_ID] . ")", $M[MB_NIC] . "(" . $M[MB_ID] . ")");
            $MyIcon = "../../member/icon/" . $wid . ".gif";
            $MyIoncTag = is_file($MyIcon) ? "<IMG SRC='" . $MyIcon . "' ALIGN=absmiddle BORDER=0 WIDTH=20 WIDTH=20>" : $Default_Icon;
            $IdLayQue = "'" . $M[MB_NAME] . "','" . $wid . "','" . $M[MB_URL] . "','" . $friendtype . "','" . $table . "','" . $v_LogId . "',event";
            $Esc_Name = $bbs[NameIcon] ? $MyIoncTag . $NameSet[$bbs[NameType]] : $NameSet[$bbs[NameType]];
            $LinkType1 = "<a style='cursor:pointer' onclick=\"getUserIdLayer(" . $IdLayQue . ");\">" . $Esc_Name . "</a>";
            $LinkType2 = "<a href='mailto:" . $M[MB_EMAIL] . "'>" . $Esc_Name . "</a>";
            $LinkType3 = $Esc_Name;
            $LinkSet = array($LinkType1, $LinkType2, $LinkType3);
            return $v_LogId ? $LinkSet[$bbs[NameLink]] : $LinkSet[2];
        }
    }
    $NameSet = array($wname, $wname, 'guest', $wname . "(guest)", $wname . "(guest)");
    $Esc_Name = $bbs[NameIcon] ? $Default_Icon . $NameSet[$bbs[NameType]] : $NameSet[$bbs[NameType]];
    $LinkType1 = $LinkType2 = $v_LogId && $wmail ? "<a href='mailto:" . $wmail . "'>" . $Esc_Name . "</a>" : $Esc_Name;
    $LinkType3 = $Esc_Name;
    $LinkSet = array($LinkType1, $LinkType2, $LinkType3);
    echo $ggg;
    return $v_LogId ? $LinkSet[$bbs[NameLink]] : $LinkSet[2];
}
Esempio n. 3
0
File: buy.php Progetto: skin/planty
<?php

session_start();
require 'inc/database.php';
require 'inc/commons.php';
checkUserLoggedIn();
include 'inc/header.php';
$friend = getFriend($_GET["friendID"]);
$plant = getPlant($_GET["plantID"]);
?>
<div class="row">

  <div class="large-8 small-12 columns card">

    <div class="titleOnCard">
      Your Selection
    </div>
  <ul class="pricing-table">
    <li class="title"><?php 
echo $plant->name;
?>
</li>

    <li class="description">
      <div class="row">
        <div class="large-12 small-12 columns">
              <img src="<?php 
echo getPlantImage($plant->id);
?>
" />
        </div>
 public function stranger()
 {
     $uid = (int) $_GET['id'];
     if (empty($uid)) {
         $this->redirect('', '', 'index');
     } else {
         $dao = D('User');
         $Profile = $dao->find($uid);
         if (empty($Profile)) {
             $this->redirect('', '', 'index');
         }
     }
     $this->assign('profile', $Profile);
     /*
      * get current user's friends
      */
     $currentUserFriend = getFriend($uid);
     shuffle($currentUserFriend);
     foreach ($currentUserFriend as &$key) {
         $key = array('uid' => current(array_diff($key, array($uid))));
     }
     //get user info
     for ($i = 0; $i < count($currentUserFriend); $i++) {
         $friend_uid = $currentUserFriend[$i]['uid'];
         $currentUserFriendShuffle[$i]['uid'] = $friend_uid;
         $currentUserFriendShuffle[$i]['userInfo'] = getUserBasicInfo($friend_uid);
         if ($i == 7) {
             break;
         }
     }
     $this->assign('currentUserFriend', $currentUserFriendShuffle);
     $this->display();
 }
Esempio n. 5
0
}
//회원정보 공유설정
if ($action == 'myconfig') {
    if ($myconf_new) {
        $QUE = "INSERT INTO kimsmall7_mbrconf\n\t\t(MC_MB_ID,MC_NAME,MC_EMAIL,MC_HOME,MC_SEX,MC_AGE,MC_PHONE,MC_GROUP,MC_BIRTH,\n\t\t MC_ADDR,MC_PAPER,MC_FRIEND,MC_ALERT_P,MC_ALERT_F,MC_ALERT_B,MC_INTRO)\n\t\tVALUES\n\t\t('{$v_LogId}','{$name}','{$email}','{$home}','{$sex}','{$age}','{$phone}','{$group}','{$birth}',\n\t\t '{$addr}','{$rcv_paper}','{$rcv_friend}','{$alert_paper}','{$alert_friend}','{$alert_black}','{$intro}')";
    } else {
        $QUE = "UPDATE kimsmall7_mbrconf SET \n\t\tMC_NAME='{$name}',\n\t\tMC_EMAIL='{$email}',\n\t\tMC_HOME='{$home}',\n\t\tMC_SEX='{$sex}',\n\t\tMC_AGE='{$age}',\n\t\tMC_PHONE='{$phone}',\n\t\tMC_GROUP='{$group}',\n\t\tMC_BIRTH='{$birth}',\n\t\tMC_ADDR='{$addr}',\n\t\tMC_PAPER='{$rcv_paper}',\n\t\tMC_FRIEND='{$rcv_friend}',\n\t\tMC_ALERT_P='{$alert_paper}',\n\t\tMC_ALERT_F='{$alert_friend}',\n\t\tMC_ALERT_B='{$alert_black}',\n\t\tMC_INTRO='{$intro}'\n\t\tWHERE MC_MB_ID='{$v_LogId}'";
    }
    db_query($QUE, $DB_CONNECT);
    getLink($THIS_FILE . '?query=paper&page=myconf');
}
//친구,블랙리스트 등록
if ($action == 'friend_regis') {
    $MBCONF = db_fetch_array(db_query("SELECT * FROM kimsmall7_mbrconf WHERE MC_MB_ID='" . $id . "'", $DB_CONNECT));
    if ($MBCONF[MC_FRIEND] == 2) {
        if (getFriend($id) == 'black') {
            echo "<script language=javascript>";
            echo "alert('{$id}님께서 회원등록 요청을 거부하셨습니다.       ');";
            echo "parent.document.id_form.id.value='';";
            echo "parent.document.id_form.id.focus();";
            echo "</script>";
            exit;
        }
    }
    if ($MBCONF[MC_FRIEND] == 3) {
        echo "<script language=javascript>";
        echo "alert('{$id}님께서 회원등록 요청을 거부하셨습니다.       ');";
        echo "parent.document.id_form.id.value='';";
        echo "parent.document.id_form.id.focus();";
        echo "</script>";
        exit;
 public function index()
 {
     $uid = (int) $_GET['id'];
     if (empty($uid)) {
         if (empty($this->userId)) {
             $this->redirect('', '', 'index');
         } else {
             $uid = $this->userId;
             $Profile = $this->userInfo;
         }
     } else {
         if (empty($this->userId)) {
             $this->redirect('', '', 'index');
         } else {
             if ($uid == $this->userId) {
                 $uid = $this->userId;
                 $Profile = $this->userInfo;
             } else {
                 $user = new ProfileAction();
                 $userRelation = $user->getFriendRelation($uid);
                 if ($userRelation == 'stranger') {
                     $this->redirect('', '', 'profile', '', array('id' => $uid));
                 }
             }
         }
     }
     $dao = D('User');
     $Profile = $dao->find($uid);
     $this->assign('profile', $Profile);
     /*
      * get current user's friends
      */
     $currentUserFriend = getFriend($uid);
     $i = 0;
     $j = 1;
     foreach ($currentUserFriend as &$key) {
         $key = array('uid' => current(array_diff($key, array($uid))));
         $key += array('userInfo' => getUserBasicInfo($key['uid']));
         $key += array('key' => $i);
         $key += array('id' => $j);
         $j++;
         if ($i == 9) {
             $i = 0;
         } else {
             $i++;
         }
     }
     $this->assign('currentUserFriend', $currentUserFriend);
     /*
      * get user count
      */
     $friendCount = count($currentUserFriend);
     $this->assign('friendCount', $friendCount);
     /*
      * get header
      */
     $name = '<a href="' . url('', '', 'profile', '', array('id' => $uid)) . '">' . $Profile['name'] . '</a>';
     $pageHeader = sprintf(L('_friends_header'), $name);
     if ($currentUserFriend) {
         $pageSubheader = sprintf(L('_friends_subheader1'), $name, $friendCount);
     } else {
         $pageSubheader = sprintf(L('_friends_subheader2'), $name);
     }
     $this->assign('pageHeader', $pageHeader);
     $this->assign('pageSubheader', $pageSubheader);
     $this->display();
 }
Esempio n. 7
0
        getTargetLink('', $target, $alert);
    }
}
if ($action == 'send_paper') {
    $msgtime = date("YmdHis");
    if ($id) {
        include '../../../conf/member_info.php';
        $PAPER_NUM = db_fetch_array(db_query("SELECT count(*) FROM kimsmall7_paper WHERE PP_TOID='" . $id . "'", $DB_CONNECT));
        if ($PAPER_NUM[0] > $mbr[max_msgnum]) {
            getTargetLink($THIS_FILE . '?id=' . $id, $target, "{$MEMBER['MB_NIC']}님의 쪽지함이 가득차서 더이상 쪽지를 받을 수 없습니다.");
        }
        if ($MBCONF[MC_PAPER] == 2) {
            getTargetLink($THIS_FILE . '?id=' . $id, $target, "{$MEMBER['MB_NIC']}님께서 쪽지수신을 거부하였습니다.");
        }
        if ($MBCONF[MC_PAPER] == 3) {
            if (getFriend($id) != 'friend' && getFriend($id) != 'me') {
                getTargetLink($THIS_FILE . '?id=' . $id, $target, "{$MEMBER['MB_NIC']}님께서 쪽지수신을 거부하였습니다.");
            }
        }
        if ($MBCONF[MC_ALERT_P]) {
            $mfile = '../../../member/msg/' . $id . '.cgi';
            $fp = fopen($mfile, "w");
            fwrite($fp, $msgtime);
            fclose($fp);
            @chmod($mfile, 0707);
        }
    }
    $QUE = "INSERT INTO kimsmall7_paper\n\t(PP_FROMID,PP_TOID,PP_COMMENT,PP_READ,PP_BOX,PP_DATE)\n\tVALUES\n\t('{$v_LogId}','{$id}','{$content}','0','0','{$msgtime}')";
    db_query($QUE, $DB_CONNECT);
    if ($stop) {
        exit;