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'];
示例#2
0
 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'] = "";
     }
 }
示例#3
0
<?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 {
    }
示例#4
0
 $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");
示例#5
0
$user = isset($user) ? $user : '******';
$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
<?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';
    }
}
示例#7
0
 function guest_allowed()
 {
     if (!GROUPWARE_ALLOW_GUEST and !users::get_user()) {
         die(GROUPWARE_ALLOW_GUEST_TEXT);
     }
 }
示例#8
0
        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");
}