当前位置: 首页>>代码示例>>PHP>>正文


PHP Users::checkUser方法代码示例

本文整理汇总了PHP中Users::checkUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Users::checkUser方法的具体用法?PHP Users::checkUser怎么用?PHP Users::checkUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Users的用法示例。


在下文中一共展示了Users::checkUser方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: check_Register

 /**
  * checks if entered values before registering are valid.
  * @param $values array with Username,Password, ConfirmPass and Email.
  * @return string Info: Returns a string, if input data is valid then "success" is returned, else an array with errors
  */
 public function check_Register($values)
 {
     // check values
     if (isset($values["Username"]) and isset($values["Password"]) and isset($values["ConfirmPass"]) and isset($values["Email"])) {
         $user = Users::checkUser($values["Username"]);
         $pass = Users::checkPassword($values["Password"]);
         $cpass = Users::confirmPassword($pass, $values["Password"], $values["ConfirmPass"]);
         $email = Users::checkEmail($values["Email"]);
     } else {
         $user = "";
         $pass = "";
         $cpass = "";
         $email = "";
     }
     if (helpers::check_if_game_client() or isset($FORCE_INGAME)) {
         if (isset($_POST["TaC"])) {
             $tac = "success";
         }
     } else {
         $tac = "success";
     }
     if ($user == "success" and $pass == "success" and $cpass == "success" and $email == "success" and $tac == "success") {
         return "success";
     } else {
         global $TOS_URL;
         $pageElements = array('USERNAME' => $user, 'PASSWORD' => $pass, 'CPASSWORD' => $cpass, 'EMAIL' => $email, 'TOS_URL' => $TOS_URL);
         if ($user != "success") {
             $pageElements['USERNAME_ERROR'] = 'TRUE';
         } else {
             $pageElements['USERNAME_ERROR'] = 'FALSE';
         }
         if ($pass != "success") {
             $pageElements['PASSWORD_ERROR'] = 'TRUE';
         } else {
             $pageElements['PASSWORD_ERROR'] = 'FALSE';
         }
         if ($cpass != "success") {
             $pageElements['CPASSWORD_ERROR'] = 'TRUE';
         } else {
             $pageElements['CPASSWORD_ERROR'] = 'FALSE';
         }
         if ($email != "success") {
             $pageElements['EMAIL_ERROR'] = 'TRUE';
         } else {
             $pageElements['EMAIL_ERROR'] = 'FALSE';
         }
         if (isset($_POST["TaC"])) {
             $pageElements['TAC_ERROR'] = 'FALSE';
         } else {
             $pageElements['TAC_ERROR'] = 'TRUE';
         }
         return $pageElements;
     }
 }
开发者ID:cls1991,项目名称:ryzomcore,代码行数:59,代码来源:users.php

示例2: Users

<?php

session_start();
require_once '../core/User.class.php';
if (isset($_POST['sign-in'])) {
    $user = new Users($_POST['user'], md5($_POST['password']));
    //echo $user->getUserNick().'<br/>';
    //echo $user->getUserPassword().'<br/>';
    //$user->checkUser();
    //echo $user->getUserId();
    if ($user->checkUser()) {
        $_SESSION['admin']['admin_id'] = $user->getUserId();
        $_SESSION['admin']['admin_nick'] = $user->getUserNick();
        //echo "checkUser";
        header("Location: ../../../");
    } else {
        //echo "No checkUser";
        header("Location: ../../../");
    }
} else {
    //echo "prueba";
    header("Location: ../../../");
}
开发者ID:aarocr,项目名称:gf-scouting,代码行数:23,代码来源:sign-in.php

示例3: header

<?php

include_once "config.php";
include_once "includes/functions.php";
//print_r($_GET);die;
if (isset($_REQUEST['code'])) {
    $gClient->authenticate();
    $_SESSION['token'] = $gClient->getAccessToken();
    header('Location: ' . filter_var($redirect_url, FILTER_SANITIZE_URL));
}
if (isset($_SESSION['token'])) {
    $gClient->setAccessToken($_SESSION['token']);
}
if ($gClient->getAccessToken()) {
    $userProfile = $google_oauthV2->userinfo->get();
    //print_r($userProfile);exit;
    //DB Insert
    $gUser = new Users();
    $_SESSION['registration_id'] = $gUser->checkUser('google', $userProfile['id'], $userProfile['given_name'], $userProfile['family_name'], $userProfile['email'], $userProfile['gender'], $userProfile['locale'], $userProfile['link'], $userProfile['picture']);
    //echo $_SESSION['registration_id'];exit;
    //$_SESSION['google_data'] = $userProfile; // Storing Google User Data in Session
    //$_SESSION['registration_id'];
    //header("location: account.php");
    $_SESSION['token'] = $gClient->getAccessToken();
} else {
    $authUrl = $gClient->createAuthUrl();
}
/*
if(isset($authUrl)) {
	echo '<a href="'.$authUrl.'"><img src="images/glogin.png" alt=""/></a>';
} */
开发者ID:neelmanis,项目名称:Jobready_New,代码行数:31,代码来源:g_login.php

示例4: header

    header('Location: index.php');
} elseif (isset($_REQUEST['oauth_token']) && $_SESSION['token'] == $_REQUEST['oauth_token']) {
    //Successful response returns oauth_token, oauth_token_secret, user_id, and screen_name
    $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $_SESSION['token'], $_SESSION['token_secret']);
    $access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);
    if ($connection->http_code == '200') {
        //Redirect user to twitter
        $_SESSION['status'] = 'verified';
        $_SESSION['request_vars'] = $access_token;
        //Insert user into the database
        $user_info = $connection->get('account/verify_credentials');
        $name = explode(" ", $user_info->name);
        $fname = isset($name[0]) ? $name[0] : '';
        $lname = isset($name[1]) ? $name[1] : '';
        $db_user = new Users();
        $db_user->checkUser('twitter', $user_info->id, $user_info->screen_name, $fname, $lname, $user_info->lang, $access_token['oauth_token'], $access_token['oauth_token_secret'], $user_info->profile_image_url);
        //$sql="SELECT * FROM users WHERE user_id='".$user_info->id."' ";
        //$prevQuery = mysqli_query($connection->connect,"SELECT * FROM $connection->users WHERE user_id = '".$oauth_uid."'") or die(mysqli_error($this->connect));
        //mysql_query($sql) or die();
        //Unset no longer needed request tokens
        unset($_SESSION['token']);
        unset($_SESSION['token_secret']);
        header('Location: twitter_test.php?n=' . $user_info->screen_name . '&id=' . $user_info->id . '');
    } else {
        die("error, try again later!");
    }
} else {
    if (isset($_GET["denied"])) {
        header('Location: index.php');
        die;
    }
开发者ID:ChandanAVC,项目名称:Liliput,代码行数:31,代码来源:process.php

示例5: Views

<?php

include "../models/Views.php";
include "../helpers/db.php";
include "../models/Posts.php";
include "../models/Image.php";
include "../models/Users.php";
//add Validator.php
$myview = new Views();
$myview = new Posts();
$users = new Users();
$image = new Image();
//add this method
//add validator function call here
if ($_GET["action"] == "checklogin") {
    $data = $users->checkUser($_POST["userName"], $_POST["password"]);
    if ($data) {
        session_start();
        $_SESSION["loggedin"] = 1;
        $_SESSION["userId"] = $data[0]["userId"];
        $_SESSION["profileimg"] = $data[0]["imageName"];
        header("Location: http://localhost/websites/ssl/day6/controllers/post.php");
    } else {
        header("Location: http://localhost/websites/ssl/day6/main.php");
    }
} elseif ($_GET["action"] == "logout") {
    session_start();
    $_SESSION["loggedin"] = 0;
    session_destroy();
    header("Location: http://localhost/websites/ssl/day6/main.php");
} elseif ($_GET["action"] == "userRegistration") {
开发者ID:richardHutchinson,项目名称:ssl,代码行数:31,代码来源:authentication.php

示例6: sendMessage

 public function sendMessage($input)
 {
     try {
         $inputObject = $this->processXML($input);
         if (!isset($inputObject->to)) {
             throw new Exception('To field is empty.');
         }
         if ($inputObject->to == '' && $inputObject->cc == '') {
             throw new Exception('TO and CC fields are empty.');
         }
         $totalids = $toids = $ccids = $newlist = array();
         $usersObj = new Users();
         $fromuser = $usersObj->checkUser($inputObject->userkey);
         if (!($fromuser > 0)) {
             throw new Exception('Invalid User.');
         }
         $toids = explode(',', $inputObject->to);
         $ccids = explode(',', $inputObject->cc);
         $totalids = $toids + $ccids;
         //print_r($totalids);
         foreach ($totalids as $val) {
             if (strpos($val, ';') > 0) {
                 $temp = array();
                 $temp = explode(';', $val);
                 //print_r($temp);
                 foreach ($temp as $temp1) {
                     $newlist[$temp1] = '';
                 }
             } else {
                 $newlist[$val] = '';
             }
         }
         $details = $this->objMessagesModel->getToIds($newlist);
         $details['inputlist'] = $newlist;
         $details['fromuser'] = $fromuser;
         $result = $this->objMessagesModel->createMessage($inputObject, $details);
         //echo '<pre>';
         //print_r($details);
         return $result;
     } catch (Exception $e) {
         return $this->setError($e->getMessage());
     }
 }
开发者ID:rapsody,项目名称:HeartwebApp,代码行数:43,代码来源:Messages.class.php

示例7: header

<?php

include_once "config.php";
include_once "google_functions.php";
//print_r($_GET);die;
if (isset($_REQUEST['code'])) {
    $gClient->authenticate();
    $_SESSION['token'] = $gClient->getAccessToken();
    header('Location: ' . filter_var($redirect_url, FILTER_SANITIZE_URL));
}
if (isset($_SESSION['token'])) {
    $gClient->setAccessToken($_SESSION['token']);
}
if ($gClient->getAccessToken()) {
    $userProfile = $google_oauthV2->userinfo->get();
    //DB Insert
    $gUser = new Users();
    $gUser->checkUser($userProfile['id'], $userProfile['given_name'], $userProfile['email'], $userProfile['link']);
    $_SESSION['google_data'] = $userProfile;
    // Storing Google User Data in Session
    //header("location: account.php");
    $_SESSION['token'] = $gClient->getAccessToken();
} else {
    $authUrl = $gClient->createAuthUrl();
    echo '<a href="' . $authUrl . '"></a>';
}
开发者ID:neelmanis,项目名称:Jobready_New,代码行数:26,代码来源:glogin_to_delete.php

示例8: elseif

    $masterUser = true;
}
//^[a-zA-Z0-9_$?-]$^
if (empty($password) || !preg_match("^[a-zA-Z0-9_\$?-]{8,32}\$^", $password)) {
    echo "<span class=\"error\">Please use eight to thirty two characters, letters, numbers or the following _ \$ ? &ndash; in the password</span><br />";
    $masterPassword = false;
} else {
    echo "<span class=\"valid\">" . $password . "</span><br />";
    $masterPassword = true;
}
if ($masterUser == false || $masterPassword == false) {
    //echo("<br /><strong>invalid login</strong>: ".$userName."<strong>invalid password</strong>: ".$password);
    echo "<span class=\"error_message\">There were errors in the form, please check the values.</span>";
} elseif ($masterUser == true && $masterPassword == true) {
    //echo("<strong>valid</strong>: ".$userName."<br /><strong>valid</strong>: ".$password."<br />");
    $data = $users->checkUser($userName, $password);
    if ($data) {
        session_start();
        $_SESSION["loggedin"] = 1;
        $_SESSION["userId"] = $data[0]["userId"];
        $_SESSION["profileimg"] = $data[0]["imageName"];
        //convert this into mvc aka use $myview->getView("views/header.html",array());
        //header("Location: http://localhost/websites/ssl/day6/controllers/post.php");
        header("Location: http://localhost/websites/ssl/day6/controllers/post.php?action=getAll");
    } else {
        header("Location: http://localhost/websites/ssl/day6/main.php");
    }
}
/*else{*/
/*if($_GET["action"] == "checklogin"){
			$data = $users->checkUser($_POST["userName"],$_POST["password"]);
开发者ID:richardHutchinson,项目名称:ssl,代码行数:31,代码来源:authentication.php

示例9: getIndex

 public function getIndex($usernameurl)
 {
     //$username = Request::segment(1);
     $users = new Users();
     $result = $users->checkUser($usernameurl);
     $this->layout->title = "Welcome to Sagip.ph";
     $campaign = new Campaign();
     $image = $campaign->getCampaignImage();
     $users = new Users();
     $member = $users->getRecentUsers();
     $this->layout->foot = View::make("landing.foot")->with(array('data' => $image, 'data2' => $member));
     if ($result) {
         $useridurl = $result->id;
         $activity = new Activity();
         $recent = $activity->getRecent($useridurl);
         if (!$recent) {
             $recent = false;
         }
         if (Session::has('userid')) {
             $username = Session::get('username');
             $logstatus = true;
             $userid = Session::get('userid');
             $profile = new Profile();
             $firstname = "";
             $lastname = "";
             $age = "";
             $address = "";
             $work = "";
             $website = "";
             $contact = "";
             $pic = "images/users/default.png";
             $result = $profile->getProfile($userid);
             if ($result) {
                 $firstname = $result->firstname;
                 $lastname = $result->lastname;
                 $age = $result->age;
                 if ($age == 0) {
                     $age = "";
                 }
                 $address = $result->address;
                 $work = $result->work;
                 $website = $result->website;
                 $contact = $result->contact;
                 $pic = $result->profilepic;
             }
             $data = array('username' => $username, 'logstatus' => $logstatus, 'firstname' => $firstname, 'lastname' => $lastname, 'age' => $age, 'address' => $address, 'work' => $work, 'website' => $website, 'contact' => $contact, 'profilepic' => $pic, 'recent' => $recent);
             $this->layout->head = View::make("landing.head")->with($data);
             $this->layout->body = View::make("landing.bodyprofile")->with($data);
             if (Session::get('username') != $usernameurl) {
                 $username = $usernameurl;
                 $logstatus = false;
                 $profile = new Profile();
                 $firstname = "";
                 $lastname = "";
                 $age = "";
                 $address = "";
                 $work = "";
                 $website = "";
                 $contact = "";
                 $pic = "images/users/default.png";
                 $result = $profile->getProfile($useridurl);
                 if ($result) {
                     $firstname = $result->firstname;
                     $lastname = $result->lastname;
                     $age = $result->age;
                     if ($age == 0) {
                         $age = "";
                     }
                     $address = $result->address;
                     $work = $result->work;
                     $website = $result->website;
                     $contact = $result->contact;
                     $pic = $result->profilepic;
                 }
                 $data = array('username' => $username, 'logstatus' => $logstatus, 'firstname' => $firstname, 'lastname' => $lastname, 'age' => $age, 'address' => $address, 'work' => $work, 'website' => $website, 'contact' => $contact, 'profilepic' => $pic, 'recent' => $recent);
                 $this->layout->body = View::make("landing.bodyprofile")->with($data);
             } else {
             }
             //return View::make('home')->with($data);
         } else {
             $logstatus = false;
             $profile = new Profile();
             $result = $profile->getProfile($useridurl);
             if ($result) {
                 $firstname = $result->firstname;
                 $lastname = $result->lastname;
                 $age = $result->age;
                 if ($age == 0) {
                     $age = "";
                 }
                 $address = $result->address;
                 $work = $result->work;
                 $website = $result->website;
                 $contact = $result->contact;
                 $pic = $result->profilepic;
             }
             $data = array('username' => $usernameurl, 'logstatus' => $logstatus, 'firstname' => $firstname, 'lastname' => $lastname, 'age' => $age, 'address' => $address, 'work' => $work, 'website' => $website, 'contact' => $contact, 'profilepic' => $pic, 'recent' => $recent);
             $this->layout->head = View::make("landing.head")->with($data);
             $this->layout->body = View::make("landing.bodyprofile")->with($data);
         }
//.........这里部分代码省略.........
开发者ID:centaurustech,项目名称:sagip,代码行数:101,代码来源:ProfileController.php

示例10: getTitle

 public function getTitle()
 {
     $usernameurl = Request::segment(4);
     $type = Request::segment(3);
     $user = new Users();
     $result = $user->checkUser($usernameurl);
     if ($result) {
         if ($usernameurl == Session::get('username')) {
             $logstatus = true;
             $usersid = Session::get('userid');
             $campaign = new Campaign();
             if ($type == "created") {
                 $result = $campaign->getCampaignCreatedName($usersid);
                 $result = json_encode($result);
                 return $result;
             } else {
                 $result = $campaign->getCampaignFundedName($usersid);
                 $result = json_encode($result);
                 return $result;
             }
         } else {
             $user = new Users();
             $result = $user->checkUser($usernameurl);
             if ($result) {
                 if (Session::has('userid')) {
                     $logstatus = true;
                 } else {
                     $logstatus = false;
                 }
                 $usersid = $result->id;
                 $campaign = new Campaign();
                 if ($type == "created") {
                     $result = $campaign->getCampaignCreatedName($usersid);
                     $result = json_encode($result);
                     return $result;
                 } else {
                     $result = $campaign->getCampaignFundedName($usersid);
                     $result = json_encode($result);
                     return $result;
                 }
             }
         }
     } else {
         if ($usernameurl == "" && $type == "all") {
             $campaign = new Campaign();
             $result = $campaign->getCampaignAllName();
             $result = json_encode($result);
             return $result;
         }
         Redirect::to('/');
     }
 }
开发者ID:centaurustech,项目名称:sagip,代码行数:52,代码来源:CampaignController.php

示例11: header

<?php

include_once "config.php";
include_once "includes/functions.php";
//print_r($_GET);die;
if (isset($_REQUEST['code'])) {
    $gClient->authenticate();
    $_SESSION['token'] = $gClient->getAccessToken();
    header('Location: ' . filter_var($redirect_url, FILTER_SANITIZE_URL));
}
if (isset($_SESSION['token'])) {
    $gClient->setAccessToken($_SESSION['token']);
}
if ($gClient->getAccessToken()) {
    $userProfile = $google_oauthV2->userinfo->get();
    //DB Insert
    $gUser = new Users();
    $gUser->checkUser('google', $userProfile['userMail']);
    $_SESSION['google_data'] = $userProfile;
    // Storing Google User Data in Session
    header("location: account.php");
    $_SESSION['token'] = $gClient->getAccessToken();
} else {
    $authUrl = $gClient->createAuthUrl();
}
if (isset($authUrl)) {
    echo '<a href="' . $authUrl . '"><img src="images/glogin.png" alt=""/></a>';
} else {
    echo '<a href="logout.php?logout">Logout</a>';
}
开发者ID:DavidMCerdeira,项目名称:Sharinf,代码行数:30,代码来源:index.php

示例12: Users

<?php

header('Access-Control-Allow-Origin: *');
include_once "functions.php";
if (!empty($_POST)) {
    $userid = $_POST['userid'];
    $username = $_POST['username'];
    $access_token = $_POST['access_token'];
    $access_secret = $_POST['access_secret'];
    $profile_image = $_POST['profile_image'];
    //$oauth_uid,$username,$oauth_token,$oauth_secret
    $db_user = new Users();
    print_r($db_user->checkUser($userid, $username, $access_token, $access_secret, $profile_image));
} else {
    ?>
		<h1>Test</h1> 
		<form action="Users.php" method="post"> 
		    Userid:<br /> 
		    <input type="text" name="userid" placeholder="userid" /> 
		    <br />

		    username:<br /> 
		    <input type="text" name="username" placeholder="username" value="" /> 
            <br /> 
		    access token:<br /> 
		    <input type="text" name="access_token" placeholder="access_token" value="" /> 
		    <br />
		    access secret:<br /> 
		    <input type="text" name="access_secret" placeholder="access_secret" value="" /> 
		    
开发者ID:johannes95,项目名称:project_fall_semester_2015,代码行数:29,代码来源:Users.php

示例13: Users

<html>
<link rel="stylesheet" type="text/css" href="styles.css">
<body>
<?php 
include_once "config.php";
include_once "db_store/store.php";
if (!$fbuser) {
    $fbuser = null;
    $loginUrl = $facebook->getLoginUrl(array('redirect_uri' => $homeurl, 'scope' => $fbPermissions));
    $output = '<a href="' . $loginUrl . '" >
				<img id="fb_button" src="images/login_fb.png">
				</a>';
} else {
    $user_profile = $facebook->api('/me?fields=id,first_name,last_name,email,gender,locale,picture');
    $user = new Users();
    $user_data = $user->checkUser('facebook', $user_profile['id'], $user_profile['first_name'], $user_profile['last_name'], $user_profile['email'], $user_profile['gender'], $user_profile['locale'], $user_profile['picture']['data']['url']);
    if (!empty($user_data)) {
        $output = '<h1 class="fb_details">User Profile Details </h1>';
        $output .= '<img id="fb_prof_pic" src="' . $user_data['picture'] . '">';
        $output .= '<br/><p class="fb_details"/>Facebook ID : ' . $user_data['oauth_uid'];
        $output .= '<br/><p class="fb_details"/>Name : ' . $user_data['fname'] . ' ' . $user_data['lname'];
        $output .= '<br/><p class="fb_details"/>Email : ' . $user_data['email'];
        $output .= '<br/><p class="fb_details"/>Gender : ' . $user_data['gender'];
        $output .= '<br/><p class="fb_details"/>Logout from <a href="logout.php?logout">Facebook</a>';
    } else {
        $output = '<h3 style="color:red">Some problem occurred, please try again.</h3>';
    }
}
?>
</body>
</html>
开发者ID:MohanVenkataKrishnan,项目名称:vision_login,代码行数:31,代码来源:fb_login.php

示例14: checkExistUser

 public function checkExistUser($log)
 {
     $user = new Users();
     return $user->checkUser($log);
 }
开发者ID:eroslover,项目名称:study,代码行数:5,代码来源:UsersController.php


注:本文中的Users::checkUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。