Example #1
0
 public function validateFee()
 {
     $userProfile = Yii::createObject(userProfile::className())->findOne(['user_id' => Yii::$app->user->id]);
     if ($this->withdrawal_fee > $userProfile->money) {
         $this->addError('withdrawal_fee', '提现金额大于余额!');
     }
 }
 function register()
 {
     require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/user.class.php';
     require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/userProfile.class.php';
     $userObj = new user();
     $upObj = new userProfile();
     $failure = false;
     $failureMsg = '';
     $result = array();
     if (isset($_POST['email'])) {
         $email = $_POST['email'];
         if (stristr($email, '@newscloud.com') !== false) {
             $failureMsg = ' Please use a valid email address of yours - not ours.';
             $failure = true;
         }
         // check that email isn't already registered
         $checkExist = $userObj->getId($email);
         if ($checkExist !== false) {
             $failureMsg = 'Sorry, this email address is already registered.';
             $failure = true;
         }
     } else {
         $failure = true;
     }
     if (!isset($_POST['memberName']) || !isset($_POST['pass1']) || !isset($_POST['pass2'])) {
         $failure = true;
     }
     if ($failure) {
         $msg = 'There was an error with your registration. Please try again.' . $failureMsg;
         $result['reg'] = false;
         $result['msg'] = $msg;
     } else {
         $result['reg'] = true;
         $memberName = $_POST['memberName'];
         $pass1 = $_POST['pass1'];
         $pass2 = $_POST['pass2'];
         $city = '';
         $result = $upObj->newRegistration($email, $memberName, $pass1, $pass2, $city);
         if ($result['reg']) {
             // check if it was an invitation response
             $result['msg'] = $this->buildConfirmationText($email, '');
         }
     }
     return $result;
 }
Example #3
0
    <script src="../js/verify.js"></script>

  </head>
  <body>

  <menu>
   <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="container">
    <div class="navbar-header">
      <a class="navbar-brand" href="index.php">
        <img alt="Explore" src="img/logo.png" width="25" height="25"> 探索</a>
    </div>

<?php 
if (!empty($_SESSION)) {
    $logUser = new userProfile($pdo);
    $usercls = $logUser->loadProfile($_SESSION['userid']);
    ?>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li <?php 
    if ($pageTitle == "探索") {
        echo 'class="active"';
    }
    ?>
><a href="index.php">主页</a></li>
        <li <?php 
    if ($pageTitle == "发现 - 探索") {
        echo 'class="active"';
    }
    ?>
Example #4
0
 function get_name($user_id)
 {
     $userProfile = new userProfile();
     $userProfile->where('user_id', $user_id)->get();
     return $userProfile->name;
 }
Example #5
0
<?php

//载入个人信息
$logUser = new userProfile($pdo);
$usercls = $logUser->loadProfile($_SESSION['userid']);
//载入粉丝/关注列表
$focls = new followCls($pdo);
//$folist=$focls->loadFollow($_SESSION['userid']);
?>

<maincontent>

<div class="user-card">
	<div class="left-info">
		<div class="content-head-card">
			<h3>动态<span class="user-id" id="id-user"><?php 
echo $usercls->getUid();
?>
</span></h3>
		</div>
			
		<div id="main-sharing-card-id"></div>

		<div class="refresh-column" id="main-card-sharing-more" onclick="getSharing()">更多</div>
	</div>

	<div class="right-info">
		<div class="user-background">
			<img src="<?php 
echo $usercls->getBackground();
?>
Example #6
0
 public function actionDashboard()
 {
     if (Yii::app()->user->agreeToTerms == 0) {
         $this->redirect(Yii::app()->createUrl('company/terms'));
     }
     $criteria = new CDbCriteria();
     //$criteria->condition = 'Candidate.CompanyID = :CompanyID';
     $criteria->params = array(':CompanyID' => Yii::app()->user->companyID);
     $candidatesModels = Candidate::model()->findAllByAttributes(array(), $criteria);
     $candidates = array();
     foreach (array_keys($candidatesModels) as $key) {
         $candidate = $candidatesModels[$key];
         $candidates[$key] = new stdClass();
         $candidates[$key]->ID = $candidate->CandidateID;
         $candidates[$key]->Name = sprintf('%s, %s', $candidate->LastName, $candidate->FirstName);
         $candidates[$key]->Email = $candidate->Email;
         $candidates[$key]->UserProfileID = $candidate->UserProfileID;
         $UserProfile = userProfile::model()->findbypk($candidate->UserProfileID);
         if (!isset($UserProfile)) {
             $candidates[$key]->RatingManager = "Rating Manager";
         } else {
             $candidates[$key]->RatingManager = $UserProfile->FirstName . " " . $UserProfile->LastName;
         }
         $candidates[$key]->Title = $candidate->Title;
         $candidates[$key]->HireDate = $candidate->HireDate;
         $candidates[$key]->EmployeeID = $candidate->EmployeeID;
     }
     $this->render('dashboard', array('candidates' => $candidates));
 }
Example #7
0
/**
* controller
*
* @author     Dac Chartrand <dac.chartrand@gmail.com>
* @license    http://www.fsf.org/licensing/licenses/gpl-3.0.html
*/
function sux($action, $params = null)
{
    switch ($action) {
        case 'reset':
            // --------------------------------------------------------------------
            // Reset password
            // --------------------------------------------------------------------
            $reset = new userReset();
            if ($reset->formValidate($_POST)) {
                $reset->formProcess($_POST);
                $reset->formSuccess();
            } else {
                $reset->formBuild($_POST);
            }
            break;
        case 'login':
            // --------------------------------------------------------------------
            // Login
            // --------------------------------------------------------------------
            if (!empty($params[0]) && $params[0] == 'openid') {
                // Openid registration
                $auth = new userLoginOpenID();
                if ($auth->formValidate($_POST)) {
                    $auth->formHandoff($_POST);
                } else {
                    $auth->formBuild($_POST);
                }
            } else {
                // Regular login
                $auth = new userAuthenticate();
                $auth->login();
            }
            break;
        case 'logout':
            // --------------------------------------------------------------------
            // Logout
            // --------------------------------------------------------------------
            $auth = new userAuthenticate();
            $auth->logout();
            break;
        case 'register':
            // --------------------------------------------------------------------
            // Register
            // --------------------------------------------------------------------
            if (!empty($params[0]) && $params[0] == 'openid') {
                // Openid registration
                $reg = new userRegisterOpenID();
                if ($reg->formValidate($_POST)) {
                    $reg->formHandoff($_POST);
                } else {
                    $reg->formBuild($_POST);
                }
            } else {
                // Regular registration
                $reg = new userEdit();
                if ($reg->formValidate($_POST)) {
                    $reg->formProcess($_POST);
                    $reg->formSuccess();
                } else {
                    $reg->formBuild($_POST, $_GET);
                }
            }
            break;
        case 'edit':
            // --------------------------------------------------------------------
            // Edit Registration
            // --------------------------------------------------------------------
            $user = !empty($params[0]) ? $params[0] : null;
            // Edit profile registration
            $reg = new userEdit('edit', $user);
            if ($reg->formValidate($_POST)) {
                $reg->formProcess($_POST);
                $reg->formSuccess();
            } else {
                $reg->formBuild($_POST, $_GET);
            }
            break;
        case 'avatar':
            // --------------------------------------------------------------------
            // Edit Avatar
            // --------------------------------------------------------------------
            $user = !empty($params[0]) ? $params[0] : null;
            // Edit avatar
            $reg = new userAvatar($user);
            if ($reg->formValidate($_POST)) {
                $reg->formProcess($_POST);
                $reg->formSuccess();
            } else {
                $reg->formBuild($_POST);
            }
            break;
        case 'openid':
            // --------------------------------------------------------------------
            // Edit OpenIDs
            // --------------------------------------------------------------------
            $user = !empty($params[0]) ? $params[0] : null;
            // Edit avatar
            $oid = new userOpenID($user);
            if ($oid->formValidate($_POST)) {
                $oid->formProcess($_POST);
                $oid->formSuccess();
            } else {
                $oid->formBuild($_POST);
            }
            break;
        case 'profile':
            // --------------------------------------------------------------------
            // Show user profile
            // --------------------------------------------------------------------
            // Nickname
            if (empty($params[0])) {
                if (isset($_SESSION['nickname'])) {
                    suxFunct::redirect(suxFunct::makeUrl('/user/profile/' . $_SESSION['nickname']));
                } else {
                    suxFunct::redirect(suxFunct::makeUrl('/user/register'));
                }
            }
            $u = new userProfile($params[0]);
            if (!empty($params[1]) && $params[1] == 'rss') {
                // RSS
                $u->rss();
            } else {
                // Profile
                $u->displayProfile();
            }
            break;
        default:
            // --------------------------------------------------------------------
            // Redirect to homepage
            // --------------------------------------------------------------------
            suxFunct::redirect(suxFunct::makeUrl('/home'));
    }
}
Example #8
0
<?php

//载入个人信息
$logUser = new userProfile($pdo);
$usercls = $logUser->loadProfile($_SESSION['userid']);
//载入我的收藏
$collections = new collectionCls($pdo);
//载入我的草稿
$drafts = new draftCls($pdo);
//修改资料
if ($_POST['saveProfile'] == 'saveProfile') {
    $wholeName = testInput($_POST['wholeName']);
    $location = testInput($_POST['location']);
    $sex = testInput($_POST['sex']);
    $intro = testInput($_POST['intro']);
    $nowPlace = testInput($_POST['nowPlace']);
    $place = testInput($_POST['place']);
    $detailIntro = testInput($_POST['detailIntro']);
    $wholeProfile = array($wholeName, $location, $sex, $intro, $nowPlace, $place, $detailIntro);
    $flag = 0;
    //记录用户资料填写的是否合格,小于0为不合格
    foreach ($wholeProfile as $key => $value) {
        if (strlen($value) == 0) {
            $flag = $flag - 1;
        }
    }
    if ($flag >= 0) {
        $editResult = $logUser->editProfile($_SESSION['userid'], $wholeProfile);
        if (!$editResult) {
            echo '修改失败';
        } else {
Example #9
0
<?php

require '..\\functions\\config.php';
//getSharing.php?uid=15
$uid = testInput($_GET['uid']);
$flag = 0;
if (strlen($uid) == 0) {
    echo 'the value of uid can not be NULL';
    $flag = $flag - 1;
}
if ($flag >= 0) {
    if (!$pdo) {
        echo '-1';
        //链接数据库失败
    } elseif (empty($_SESSION)) {
        echo '-2';
        //用户没有登录
    } else {
        $getSha = new sharingCls($pdo);
        $sharingList = $getSha->loadSharing($uid);
        $getUser = new userProfile($pdo);
        $userlist = $getUser->loadProfile($_SESSION['userid']);
        arsort($sharingList);
        foreach ($sharingList as $key => $value) {
            $jsonData = $jsonData . '{"face":"' . $userlist->getFace() . '","name":"' . $userlist->getName() . '","uid":"' . $value->getUid() . '","time":"' . $value->getTime() . '","sharingType":"' . $value->getSharingType() . '","img":"' . $value->getImg() . '","content":"' . $value->getContent() . '","commentNum":"' . $value->getCommentAmount() . '","likeNum":"' . $value->getLikeAmount() . '","dislikeNum":"' . $value->getDislikeAmount() . '"},';
        }
        $jsonData = substr_replace($jsonData, "", -1, 1);
        echo "{sharing:[" . $jsonData . "]}";
    }
}
session_write_close();
Example #10
0
 function manage()
 {
     $data['message'] = null;
     $countries = new Country();
     $user_profile = new userProfile();
     $countries->get();
     foreach ($countries->all as $country) {
         $data['countries'][$country->id] = $country->name;
     }
     $data['user_profile'] = $user_profile->get_by_id($this->dx_auth->get_user_id());
     if ($this->dx_auth->is_logged_in()) {
         $data['email'] = $this->dx_auth->get_user_email();
         if ($this->form_validation->run() == false) {
             $this->load->view('account/manage', $data);
         } else {
             $user_profile->country_id = $this->input->post('country');
             $user_profile->website = $this->input->post('website');
             $user_profile->name = $this->input->post('name');
             $user_profile->save();
             $data['message'] = '<p class="notice fade">Profile Details saved</p>';
             $this->load->view('account/manage', $data);
         }
     } else {
         redirect('session/login');
     }
 }
Example #11
0
<?php

require "functions/config.php";
$userAccount = testInput($_GET['people']);
//初始化个人信息
$user = new userProfile($pdo);
$usercls = $user->loadProfile($userID);
if ($userID = $user->userIsExist($userAccount)) {
    //初始化关注/粉丝数据信息
    $focls = new followCls($pdo);
    //初始化个人分享
    $shacls = new sharingCls($pdo);
    $shalist = $shacls->loadSharing($userID[0]);
    if (!empty($_SESSION)) {
        $pageTitle = "{$userAccount} - 探索";
    } else {
        header("Location:index.php");
    }
    require "includes/header.php";
    ?>

<div class="people-user-background-detail">
	<div class="people-user-heading">
		<div class="people-user-heading-left">
			<img src="user/ivydom/background-blur.jpg" alt="i<?php 
    echo $usercls->getName();
    ?>
" width="260" height="265">
			<div class="people-user-heading-left-detail">
				<div class="people-user-photo">
					<img src="<?php