當前位置: 首頁>>代碼示例>>PHP>>正文


PHP users::get_user方法代碼示例

本文整理匯總了PHP中users::get_user方法的典型用法代碼示例。如果您正苦於以下問題:PHP users::get_user方法的具體用法?PHP users::get_user怎麽用?PHP users::get_user使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在users的用法示例。


在下文中一共展示了users::get_user方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: sanitizeString

function sanitizeString($var)
{
    $var = stripslashes($var);
    $var = htmlentities($var);
    $var = strip_tags($var);
    return $var;
}
if (isset($_REQUEST['user'])) {
    $obj = new users();
    $user = $_REQUEST['user'];
    $pass = sanitizeString($_REQUEST['pass']);
    $pass_encrypt = $obj->encrypt("{$pass}");
    if ($user == "" || $pass == "") {
        echo 'not all fields have been filled';
    } else {
        if (!$obj->get_user($user)) {
            echo 'invalid username or password';
        } else {
            $row = $obj->fetch();
            $password = $row['password'];
            if ($password == $pass_encrypt) {
                if ($row['admin'] == 0) {
                    session_start();
                    $id = $row['id'];
                    echo $id;
                    include_once 'nurses.php';
                    $user_nurse = new nurses();
                    $user_nurse->get_nurse($id);
                    $user_row = $user_nurse->fetch();
                    $_SESSION['user'] = $user;
                    $_SESSION['fname'] = $user_row['nurse_fname'];
開發者ID:kennethmensah,項目名稱:software_engineering_project,代碼行數:31,代碼來源:login.php

示例2: threeusers2

 public function threeusers2($db, $rid, $id)
 {
     $users = new users();
     //判斷第5層是否達到29單
     $count2 = $users->getcountbylayer($rid, 5);
     if ($count2 == 29) {
         $usersinfo2 = $users->get_user_byid($rid);
         $loginname = $usersinfo2["loginname"];
         //增加三點位繼續享受獎金
         //echo $rid.$id;exit;
         //用戶注冊自動選擇位置與rid
         self::get_auto_area_byid($id);
         $db->query("insert into \t\tusers(rid,pid,types,loginname,pwd1,pwd2,truename,addtime,bizid,productcount,states,identityid,bank,bankno,bankname,bankaddress,tel,area) values(" . $_SESSION['autorid'] . "," . $rid . ",1,'" . $loginname . "_01','1','1','1',now(),1000,1,0,1,'中國工商銀行',1,1,1,1," . $_SESSION['autoarea'] . ")");
         //user_sub_count添加記錄
         $usersinfo = $users->get_user($loginname . "_01");
         $users->insert_count($usersinfo["id"]);
         $users->audit_user_byid($usersinfo["id"]);
         $_SESSION['autorid'] = "";
         $_SESSION['autoarea'] = "";
         //用戶注冊自動選擇位置與rid
         self::get_auto_area_byid($id);
         $db->query("insert into \t\tusers(rid,pid,types,loginname,pwd1,pwd2,truename,addtime,bizid,productcount,states,identityid,bank,bankno,bankname,bankaddress,tel,area) values(" . $_SESSION['autorid'] . "," . $rid . ",1,'" . $loginname . "_02','1','1','1',now(),1000,1,0,1,'中國工商銀行',1,1,1,1," . $_SESSION['autoarea'] . ")");
         //user_sub_count添加記錄
         $usersinfo = $users->get_user($loginname . "_02");
         $users->insert_count($usersinfo["id"]);
         $users->audit_user_byid($usersinfo["id"]);
         $_SESSION['autorid'] = "";
         $_SESSION['autoarea'] = "";
         //用戶注冊自動選擇位置與rid
         self::get_auto_area_byid($id);
         $db->query("insert into \t\tusers(rid,pid,types,loginname,pwd1,pwd2,truename,addtime,bizid,productcount,states,identityid,bank,bankno,bankname,bankaddress,tel,area) values(" . $_SESSION['autorid'] . "," . $rid . ",1,'" . $loginname . "_03','1','1','1',now(),1000,1,0,1,'中國工商銀行',1,1,1,1," . $_SESSION['autoarea'] . ")");
         //user_sub_count添加記錄
         $usersinfo = $users->get_user($loginname . "_03");
         $users->insert_count($usersinfo["id"]);
         $users->audit_user_byid($usersinfo["id"]);
         $_SESSION['autorid'] = "";
         $_SESSION['autoarea'] = "";
     }
 }
開發者ID:ekdd1987,項目名稱:panda,代碼行數:39,代碼來源:biz.class.php

示例3: users

<?php

session_start();
include "classes/users.class.php";
include "classes/email.class.php";
//in case user forgot their password.
$users = new users();
$the_error = null;
if (isset($_POST['submit'])) {
    $result = $users->get_user($_POST["email"], $_POST["password"]);
    if ($result == false) {
        echo "<p style=color:red;>Wrong username and/or password!</p>";
    }
    //if the user is valid, redirect to their account.
    if (count($result) == 1) {
        $_SESSION['loggedIn'] = 1;
        $_SESSION['email'] = $_POST['email'];
        $_SESSION['first_name'] = $result[0]['first_name'];
        $_SESSION['last_name'] = $result[0]['last_name'];
        $_SESSION['u_type'] = $result[0]['u_type'];
        $_SESSION['cid'] = $result[0]['cid'];
        $_SESSION['password'] = $_POST[0]['password'];
        $_SESSION['addr'] = $result[0]['addr'];
        $_SESSION['state'] = $result[0]['state'];
        $_SESSION['zip'] = $result[0]['zip'];
        $_SESSION['cc_num'] = $result[0]['cc_num'];
        $_SESSION['city'] = $result[0]['city'];
        header("Location:myaccount.php");
        // redirects
    } else {
    }
開發者ID:NLP-Project,項目名稱:GatorAirlines,代碼行數:31,代碼來源:log_in.php

示例4: date

 $xmlClass->close_xml_element("main", "Created on " . date("D, d M Y H:i:s", $stringClass->get_current_date()) . " by " . $_COOKIE['myforum']);
 # close XML creation process
 $xmlClass->closeXMLFile();
 #########################
 # start XML creation process (CONFIG FILE)
 $xmlClass->createXMLFile(" ", true);
 # set the Path of the file
 $xmlClass->setPath("misc/groupware/writeable/projects/shared/" . $_GET['id'] . "/config.php");
 # add comment
 $xmlClass->add_comment(XML_CLASS_COMMENT);
 # open main element
 $xmlClass->open_xml_element("config");
 # open mantainers element
 $xmlClass->open_xml_element("mantainers");
 # insert user as mantainer
 $xmlClass->add_xml_element("name", $usersClass->get_user());
 # close mantainers element
 $xmlClass->close_xml_element("mantainers");
 # open developers element
 $xmlClass->open_xml_element("developers");
 # close developers element
 $xmlClass->close_xml_element("developers");
 # close main element
 $xmlClass->close_xml_element("config", "Last Update " . date("D, d M Y H:i:s", $stringClass->get_current_date()) . "");
 # write XML file (CONFIG)
 $xmlClass->closeXMLFile();
 ##########################
 # start XML creation process (PROJECT LISTS)
 $xmlClass->createXMLFile(" ", true);
 # set the Path of the file
 $xmlClass->setPath("misc/groupware/writeable/projects/shared/" . $_GET['id'] . "/lists.php");
開發者ID:BackupTheBerlios,項目名稱:yac-svn,代碼行數:31,代碼來源:section.php

示例5: isset

$user = isset($user) ? $user : '0';
$dropbox = new dropbox();
//add the users class, use 'id' for value and 'name' for text
$dropbox->add_sql_data('users', 'id', 'name');
//print the dropbox
$dropbox->print_dropbox('user', $user);
echo '<br /><br />';
//statusbar control
$statusbar = new statusbar();
$statusbar->info_text = 'Group-Office usage';
$statusbar->turn_red_point = 90;
$statusbar->print_bar(75, 100);
//how do you get user info
//the current user is stored in:
echo 'Your user ID is "' . $GO_SECURITY->user_id . '"<br />';
$user = $users->get_user($GO_SECURITY->user_id);
echo 'Your name is "' . $user['name'] . '"<br /><br />';
//now for some permission management.
//You can secure an object by giving it an ACL (Access Control List). When the user
//you logged in with was created it also got an ACL. This acl is used to protect your personal profile.
//We already got the user information in the above example so the user acl = stored in $user['acl_id'].
//So if we want to set the permissions this can be done really easily with the control: 'acl_control.inc'
echo 'This user is visible to:<br />';
//The acl_control must always be put in a form.
echo '<form name="save" method="post" action="' . $_SERVER['PHP_SELF'] . '">';
//we set the following for the control
$acl_control_acl_id = $user["acl_id"];
//we hide ourself because we do not need to protect ourself from us.
$acl_control_hide_self = true;
//TIP: look in this file for more options.
//we actually require the control here
開發者ID:BackupTheBerlios,項目名稱:hpt-obm-svn,代碼行數:31,代碼來源:oldindex.php

示例6: users

<?php

include_once 'users.php';
if (isset($_REQUEST['user'])) {
    $obj = new users();
    $user = $_REQUEST['user'];
    $result = $obj->get_user($user);
    $row = $obj->fetch();
    if ($user != $row['user']) {
        echo '<span class="ti-check"></span>username available';
    } else {
        echo '<span class="ti-alert"></span>username taken';
    }
}
開發者ID:kennethmensah,項目名稱:software_engineering_project,代碼行數:14,代碼來源:checkuser.php

示例7: guest_allowed

 function guest_allowed()
 {
     if (!GROUPWARE_ALLOW_GUEST and !users::get_user()) {
         die(GROUPWARE_ALLOW_GUEST_TEXT);
     }
 }
開發者ID:BackupTheBerlios,項目名稱:yac-svn,代碼行數:6,代碼來源:config_class.php

示例8: die

        if (substr($key, 0, 5) == "__ob_") {
            if ($value == "" or $value == "scegli...") {
                echo "- Non hai compilato il campo obbligatorio <strong>{$key}</strong>, l'azione non può essere processata.<br>";
                $flag = false;
            }
        }
    }
    if ($_SESSION['add_project_confirm_ID'] != $_POST['__ob_code']) {
        echo "- Il codicem di conferma non è valido!.<br>";
        $flag = false;
    }
    if (!$flag) {
        # die if there are some errors
        die("<br>Siamo spiacenti, ma a causa di qualche errore, la tua richiesta non può essere inoltrata correttamente al server. Verifica di aver compilato tutti i campi.<br><br><a href=\"javascript:history.back()\" title=\"indietro\">Indietro</a>");
    }
    # create STRING object
    $stringClass = new string();
    # create XML object
    $xmlClass = new xml();
    # set overwrite to true
    $xmlClass->setOverWrite(false);
    # check if XML folder exists
    if (file_exists("misc/groupware/xml/" . $stringClass->get_current_date() . "/")) {
        die("E' già presente un progetto con lo stesso nome, Prova ad aggiornare la pagina...");
    } else {
        mkdir("misc/groupware/writeable/projects/shared/" . $stringClass->get_current_date() . "/");
        mkdir("misc/groupware/writeable/projects/shared/" . $stringClass->get_current_date() . "/news/");
    }
    # starting autopilot
    $xmlClass->autopilot("misc/groupware/writeable/projects/adoption/" . $stringClass->get_current_date() . ".xml", $_POST, $usersClass->get_user(), "project");
}
開發者ID:BackupTheBerlios,項目名稱:yac-svn,代碼行數:31,代碼來源:add.php


注:本文中的users::get_user方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。