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


PHP userCheck函数代码示例

本文整理汇总了PHP中userCheck函数的典型用法代码示例。如果您正苦于以下问题:PHP userCheck函数的具体用法?PHP userCheck怎么用?PHP userCheck使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: orongoauthconfirm

 public function orongoauthconfirm()
 {
     if (!isset($_SESSION["_orongoauth_confirm_uid"]) || !isset($_SESSION["_orongoauth_confirm_action"]) || !isset($_SESSION["_orongoauth_confirm_expire"])) {
         $this->killConfirm();
         throw new Exception("Nothing to confirm!");
     }
     #expire
     if ($_SESSION["_orongoauth_confirm_expire"] < time()) {
         $this->killConfirm();
         throw new Exception("This action has been expired.");
     }
     $user = $this - userCheck();
     #uid
     if ($_SESSION["_orongoauth_confirm_uid"] != $user->getID()) {
         $this->killConfirm();
         throw new Exception("Invalid confirm user ID");
     }
     #action
     switch ($_SESSION["_orongoauth_confirm_action"]) {
         case 'update':
             break;
         default:
             $this->killConfirm();
             throw new Exception("Unknown confirm action!");
             break;
     }
 }
开发者ID:JacoRuit,项目名称:orongocms,代码行数:27,代码来源:OrongoAuthTerminal.php

示例2: transaksi

function transaksi()
{
    include "config.php";
    $conn = connect_database();
    if (userCheck($conn, $_POST['id'])) {
        $kodealat = mysqli_real_escape_string($conn, $_POST["kode-alat"]);
        $tanggal = date("Y-m-d", time());
        if (isset($_POST["tanggal-pinjam"])) {
            $tanggal = $_POST["tanggal-pinjam"];
        }
        if (!isAvailable($conn, $kodealat, $tanggal, $_POST["tanggal-kembali"])) {
            echo "Maaf, alat pada hari tersebut tidak dapat dipinjam </br>";
        } else {
            if (strcmp($_POST["jenis"], "peminjaman") == 0) {
                $sql = "INSERT INTO `peminjaman` (`id_user`, `id_alat`, `tanggal_rencana_pengembalian`) VALUES ('{$_POST['id']}','{$kodealat}','" . str_replace('T', ' ', $_POST["tanggal-kembali"]) . ":00')";
            } else {
                //booking
                $sql = "INSERT INTO `booking` (`id_user`, `id_alat`, `tanggal_rencana_peminjaman`, `tanggal_rencana_pengembalian`) VALUES ('{$_POST['id']}','{$kodealat}','" . str_replace('T', ' ', $_POST["tanggal-pinjam"]) . ":00','" . str_replace('T', ' ', $_POST["tanggal-kembali"]) . ":00')";
            }
            if (mysqli_query($conn, $sql)) {
                echo "Data anda berhasil disimpan</br>";
            } else {
                echo mysqli_error($conn);
            }
        }
    } else {
        //tidak ada user dengan id tersebut
        echo "Maaf, user dengan ID sekian belum terdaftar. Mohon daftarkan diri Anda terlebih dahulu!";
    }
    echo '<a href="../index.php"> Kembali ke halaman Transaksi</a>';
}
开发者ID:fitrakun,项目名称:AIPA,代码行数:31,代码来源:transaksi.php

示例3: pageController

function pageController()
{
    $data = [];
    $data['username'] = $_POST["uname"] ? $_POST["uname"] : " ";
    $data['password'] = $_POST["passwd"] ? $_POST["passwd"] : " ";
    $data['logincheck'] = userCheck($data['username'], $data['password']);
    return $data;
}
开发者ID:Yeasayer,项目名称:codeup_web_exercises,代码行数:8,代码来源:authorized.php

示例4: xoops_user_validate

 function xoops_user_validate($username, $password, $validate)
 {
     global $xoopsModuleConfig, $xoopsConfig;
     if ($xoopsModuleConfig['site_user_auth'] == 1) {
         if ($ret = check_for_lock(basename(__FILE__), $username, $password)) {
             return $ret;
         }
         if (!checkright(basename(__FILE__), $username, $password)) {
             mark_for_lock(basename(__FILE__), $username, $password);
             return array('ErrNum' => 9, "ErrDesc" => 'No Permission for plug-in');
         }
     }
     if ($validate['passhash'] != '') {
         if ($validate['passhash'] != sha1($validate['time'] - $validate['rand'] . $validate['uname'] . $validate['pass'])) {
             return array("ERRNUM" => 4, "ERRTXT" => 'No Passhash');
         }
     } else {
         return array("ERRNUM" => 4, "ERRTXT" => 'No Passhash');
     }
     return array('ERRNUM' => 1, 'RESULT' => userCheck($validate['uname'], $validate['email'], $validate['pass'], $validate['vpass']));
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:21,代码来源:xoops_user_validate.php

示例5: T_

echo T_("Update");
?>
"/>
    </li>

  </ul>
</form>
<?php 
// password update
if (!$authRealm) {
    // password update
    if (isset($_POST['changepw']) && !empty($_POST['oldpw']) && !empty($_POST['newpw']) && !empty($_POST['newpw2'])) {
        // create user
        if ($_POST['newpw'] !== $_POST['newpw2']) {
            errorMessage(T_("Password change"), T_("New passwords don't match! Password unchanged."));
        } elseif (!userCheck($auth['name'], $_POST['oldpw'])) {
            errorMessage(T_("Password change"), T_("Old password doesn't match! Password unchanged."));
        } else {
            userUpd($auth['name'], $_POST['newpw']);
            infoMessage(T_("Password change"), T_("Password successfully changed."));
        }
    }
    ?>
<form action="<?php 
    echo $ref;
    ?>
" method="post" onsubmit="validate(event);">
  <ul>
    <h3><?php 
    echo T_("Password");
    ?>
开发者ID:dg-wfk,项目名称:dl,代码行数:31,代码来源:prefs.php

示例6: saveuser

function saveuser($uid, $name, $uname, $email, $femail, $url, $pass, $vpass, $bio, $user_avatar, $user_icq, $user_occ, $user_from, $user_intrest, $user_sig, $user_viewemail, $user_aim, $user_yim, $user_msnm, $attach, $usend_email, $uis_visible, $user_lnl, $C1, $C2, $C3, $C4, $C5, $C6, $C7, $C8, $M1, $M2, $T1, $T2, $B1, $MAX_FILE_SIZE, $raz_avatar)
{
    global $NPDS_Prefix;
    global $user, $userinfo, $system, $minpass;
    $cookie = cookiedecode($user);
    $check = $cookie[1];
    $result = sql_query("SELECT uid, email FROM " . $NPDS_Prefix . "users WHERE uname='{$check}'");
    list($vuid, $vemail) = sql_fetch_row($result);
    if ($check == $uname and $uid == $vuid) {
        if (isset($pass) && "{$pass}" != "{$vpass}") {
            message_error("<i class=\"fa fa-exclamation\"></i>&nbsp;" . translate("Both passwords are different. They need to be identical.") . "<br /><br />", "");
        } elseif ($pass != "" && strlen($pass) < $minpass) {
            message_error("<i class=\"fa fa-exclamation\"></i>&nbsp;" . translate("Sorry, your password must be at least") . " <strong>{$minpass}</strong> " . translate("characters long") . "<br /><br />", "");
        } else {
            $stop = userCheck("edituser", $email);
            if (!$stop) {
                if ($bio) {
                    $bio = FixQuotes(strip_tags($bio));
                }
                if ($attach) {
                    $t = 1;
                } else {
                    $t = 0;
                }
                if ($user_viewemail) {
                    $a = 1;
                } else {
                    $a = 0;
                }
                if ($usend_email) {
                    $u = 1;
                } else {
                    $u = 0;
                }
                if ($uis_visible) {
                    $v = 0;
                } else {
                    $v = 1;
                }
                if ($user_lnl) {
                    $w = 1;
                } else {
                    $w = 0;
                }
                if ($url != "") {
                    if (!substr_count($url, "http://")) {
                        $url = "http://" . $url;
                    }
                    if (trim($url) == "http://") {
                        $url = "";
                    }
                }
                include_once "modules/upload/upload.conf.php";
                global $avatar_size;
                if (!$avatar_size) {
                    $avatar_size = "80*100";
                }
                $avatar_limit = explode("*", $avatar_size);
                if ($DOCUMENTROOT != "") {
                    $rep = $DOCUMENTROOT;
                } else {
                    global $DOCUMENT_ROOT;
                    if ($DOCUMENT_ROOT) {
                        $rep = $DOCUMENT_ROOT;
                    } else {
                        $rep = $_SERVER['DOCUMENT_ROOT'];
                    }
                }
                if ($B1 != "none") {
                    global $language;
                    include_once "modules/upload/lang/upload.lang-{$language}.php";
                    include_once "modules/upload/clsUpload.php";
                    $upload = new Upload();
                    $upload->maxupload_size = $MAX_FILE_SIZE;
                    $field1_filename = trim($upload->getFileName("B1"));
                    $suffix = strtoLower(substr(strrchr($field1_filename, '.'), 1));
                    if ($suffix == "gif" or $suffix == "jpg" or $suffix == "png") {
                        $field1_filename = removeHack(preg_replace('#[/\\\\:\\*\\?"<>|]#i', '', rawurldecode($field1_filename)));
                        $field1_filename = preg_replace('#\\.{2}|config.php|/etc#i', '', $field1_filename);
                        if ($field1_filename) {
                            if ($autorise_upload_p) {
                                $user_dir = $racine . "/users_private/" . $uname . "/";
                                if (!is_dir($rep . $user_dir)) {
                                    @umask("0000");
                                    if (@mkdir($rep . $user_dir, 0777)) {
                                        $fp = fopen($rep . $user_dir . "index.html", 'w');
                                        fclose($fp);
                                    } else {
                                        $user_dir = $racine . "/users_private/";
                                    }
                                }
                            } else {
                                $user_dir = $racine . "/users_private/";
                            }
                            if ($upload->saveAs($uname . "." . $suffix, $rep . $user_dir, "B1", true)) {
                                $old_user_avatar = $user_avatar;
                                $user_avatar = $user_dir . $uname . "." . $suffix;
                                $img_size = @getimagesize($rep . $user_avatar);
                                if ($img_size[0] > $avatar_limit[0] or $img_size[1] > $avatar_limit[1]) {
                                    $raz_avatar = true;
//.........这里部分代码省略.........
开发者ID:Jireck-npds,项目名称:npds_dune,代码行数:101,代码来源:user.php

示例7: register_check

function register_check()
{
    global $db, $user_cfg, $sec_code, $MAIN_CFG;
    $username = Fix_Quotes($_POST['username'], 1);
    $email = strtolower(Fix_Quotes($_POST['email'], 1));
    $password = Fix_Quotes($_POST['password'], 1);
    if ($password != Fix_Quotes($_POST['password_confirm'], 1)) {
        cpg_error(_PASSDIFFERENT);
    } else {
        if (strlen($password) < $MAIN_CFG['member']['minpass'] && $password != '') {
            cpg_error(_YOUPASSMUSTBE . ' <b>' . $MAIN_CFG['member']['minpass'] . '</b> ' . _CHARLONG);
        }
    }
    $fields['username'] = $username;
    $fields['email'] = $email;
    $fields['password'] = $password;
    $fields['coppa'] = $_POST['coppa'];
    // Check the additional activated fields
    $fieldlist = $valuelist = '';
    $content = check_fields($fieldlist, $valuelist, $fields);
    userCheck($username, $email);
    echo '<form action="' . URL::index('&amp;file=register') . '" method="post">
<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
  <tr>
	<td class="row1" align="center">
	  ' . $username . ', ' . _USERCHECKDATA . '<br /><br />
	  <table border="0" cellpadding="1" cellspacing="4">
	  <tr><td><b>' . _USERNAME . ':</b></td><td>' . $username . '</td></tr>
	  <tr><td><b>' . _EMAILADDRESS . ':</b></td><td>' . $email . '</td></tr>
	  <tr><td><b>' . _PASSWORD . ':</b></td><td><i>' . _MA_HIDDEN . '</i></td></tr>' . $content;
    if ($sec_code & 4) {
        echo '<tr>
	<td class="row1"><span class="gen">' . _SECURITYCODE . ':</span></td>
	<td class="row2">' . generate_secimg() . '</td></tr>
  <tr>
	<td class="row1"><span class="gen">' . _TYPESECCODE . ':</span></td>
	<td class="row2"><input type="text" name="gfx_check" size="7" maxlength="6" /></td>
  </tr>';
    }
    echo '</table><br />';
    if (!$user_cfg['requireadmin']) {
        echo $user_cfg['useactivate'] ? _YOUWILLRECEIVE : _YOUWILLRECEIVE2;
    } else {
        echo _WAITAPPROVAL;
    }
    $_SESSION['REGISTER'] = $fields;
    echo '<input type="hidden" name="op" value="finish" /><br /><br />
	<input type="submit" value="' . _FINISH . '" /> <a href="javascript:history.go(-1);"><input type="button" value="Back" onclick="history.go(-1)" /></a>
	</td>
  </tr>
</table>
</form>';
}
开发者ID:cbsistem,项目名称:nexos,代码行数:53,代码来源:register.php

示例8: userCheck

				$('#post_content').val("Write Something you want to share ... ");
			}
        });
    });
	
});
</script>
</head>
<body>
<?php 
include_once 'DB.php';
include 'auth.php';
$db = Database::getInstance();
$conn = $db->getConnection();
$conn->select_db('cc');
$check = userCheck();
$user = $_COOKIE['user'];
if ($check) {
    $query = "select user_id from tokens where token='" . normalizeString($_COOKIE['tokenID']) . "'";
    $res = $conn->query($query);
    $result = $res->fetch_assoc();
    if ($res->num_rows === 1 and isset($result['user_id'])) {
        $user = $result['user_id'];
        ?>
<div class="main-body">
<div class="col-lg-12 col-md-12 col-sm-12">
<?php 
        include 'include/nav-header.php';
        ?>
<div class="col-lg-3 col-md-3 sidebar">
  <ul class="nav nav-pills nav-stacked">
开发者ID:ronakjain2012,项目名称:Cloud_Compiler,代码行数:31,代码来源:posts.php

示例9: md5

         }
         $user->setVar('pass', md5($password));
     } elseif ($user->isNew()) {
         $errors[] = _PROFILE_MA_NOPASSWORD;
     }
     if ($xoopsUser->isAdmin()) {
         //admins can set level (activated/deactivated) for users
         $user->setVar('level', intval($_POST['level']));
     }
 }
 $user->setVar('uname', $_POST['uname']);
 $user->setVar('loginname', $_POST['loginname']);
 $user->setVar('rank', intval($_POST['rank']));
 $user->setVar('name', $_POST['name']);
 include_once '../include/functions.php';
 $stop = userCheck($user);
 if ($stop != "") {
     $errors[] = $stop;
 }
 // Dynamic fields
 $profile_handler =& xoops_gethandler('profile');
 // Get fields
 $fields =& $profile_handler->loadFields();
 // Get ids of fields that can be edited
 $gperm_handler =& xoops_gethandler('groupperm');
 $editable_fields = $gperm_handler->getItemIds('profile_edit', $xoopsUser->getGroups(), $xoopsModule->getVar('mid'));
 foreach (array_keys($fields) as $i) {
     $fieldname = $fields[$i]->getVar('field_name');
     if (in_array($fields[$i]->getVar('fieldid'), $editable_fields) && isset($_REQUEST[$fieldname])) {
         $user->setVar($fieldname, $_REQUEST[$fieldname]);
     }
开发者ID:BackupTheBerlios,项目名称:xoops4-svn,代码行数:31,代码来源:user.php

示例10: cpg_error

 } else {
     if ($_POST['mode'] == 'addConf') {
         if ($CPG_SESS['admin']['page'] != 'users') {
             cpg_error(_ERROR_BAD_LINK, _SEC_ERROR);
         }
         $username = Fix_Quotes($_POST['username'], 1);
         $email = Fix_Quotes($_POST['email'], 1);
         $password = Fix_Quotes($_POST['password'], 1);
         if ($password != Fix_Quotes($_POST['password_confirm'], 1)) {
             cpg_error(_PASSDIFFERENT);
         } else {
             if (strlen($password) < $MAIN_CFG['member']['minpass'] && $password != '') {
                 cpg_error(_YOUPASSMUSTBE . ' <b>' . $MAIN_CFG['member']['minpass'] . '</b> ' . _CHARLONG);
             }
         }
         userCheck($_POST['username'], $_POST['email']);
         $fieldlist = $valuelist = '';
         check_fields($fieldlist, $valuelist, $fields);
         if (empty($password)) {
             $password = make_pass(8, 5);
         }
         $result = $db->sql_query('INSERT INTO ' . $user_prefix . '_users (username, user_email, user_password, user_regdate, user_avatar' . $fieldlist . ') ' . "VALUES ('{$username}', '{$email}', '" . md5($password) . "', '" . time() . "', '" . $MAIN_CFG['avatar']['default'] . "'" . $valuelist . ')');
         $message = _WELCOMETO . " {$MAIN_CFG['global']['sitename']}!\n\n" . _YOUUSEDEMAIL . " ({$email}) " . _TOREGISTER . " {$MAIN_CFG['global']['sitename']}.\n\n " . _FOLLOWINGMEM . "\n" . _USERNAME . ": {$username}\n" . _PASSWORD . ": {$password}";
         send_mail($dummy, $message, 0, _ACTIVATIONSUB, $email, $username);
         URL::redirect(URL::admin());
     } else {
         if ($_POST['mode'] == 'promoteConf') {
             if ($CPG_SESS['admin']['page'] != 'users') {
                 cpg_error(_ERROR_BAD_LINK, _SEC_ERROR);
             }
             if (can_admin()) {
开发者ID:cbsistem,项目名称:nexos,代码行数:31,代码来源:users.php

示例11: finishNewUser

function finishNewUser($username, $user_email, $user_password, $user_password2, $usertype, $gradyear, $company, $designation, $fullname, $specialization, $random_num, $gfx_check)
{
    //FIX:DOMSNITT
    global $stop, $EditedMessage, $adminmail, $sitename, $Default_Theme, $user_prefix, $db, $storyhome, $module_name, $nukeurl;
    include "header.php";
    include "config.php";
    userCheck($username, $user_email);
    $user_regdate = date("M d, Y");
    if (!isset($stop)) {
        $datekey = date("F j");
        $rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
        $code = substr($rcode, 2, 6);
        if (extension_loaded("gd") and $code != $gfx_check and ($gfx_chk == 3 or $gfx_chk == 4 or $gfx_chk == 6 or $gfx_chk == 7)) {
            Header("Location: modules.php?name={$module_name}");
            die;
        }
        mt_srand((double) microtime() * 1000000);
        $maxran = 1000000;
        $check_num = mt_rand(0, $maxran);
        $check_num = md5($check_num);
        $time = time();
        $finishlink = "{$nukeurl}/modules.php?name={$module_name}&op=activate&username={$username}&check_num={$check_num}";
        $new_password = md5($user_password);
        $username = check_html($username, nohtml);
        $user_email = check_html($user_email, nohtml);
        //FIX:DOMSNITT
        $fullname = check_html($fullname, nohtml);
        $company = check_html($company, nohtml);
        $designation = check_html($designation, nohtml);
        #$result = $db->sql_query("INSERT INTO ".$user_prefix."_users_temp (user_id, username, user_email, user_password, user_regdate, check_num, time) VALUES (NULL, '$username', '$user_email', '$new_password', '$user_regdate', '$check_num', '$time')");
        $result = $db->sql_query("INSERT INTO " . $user_prefix . "_users_temp (user_id, username, user_email, user_password, user_regdate, check_num, time,usertype,gradyear,company,designation,fullname,specialization) VALUES (NULL, '{$username}', '{$user_email}', '{$new_password}', '{$user_regdate}', '{$check_num}', '{$time}','{$usertype}',{$gradyear},'{$company}','{$designation}','{$fullname}','{$specialization}')");
        //END-OF-FIX
        if (!$result) {
            echo "" . _ERROR . "<br>";
        } else {
            //FIX:DOMSNITT
            // start - HACK: AutoActivate
            global $language;
            $row = $db->sql_fetchrow($db->sql_query("SELECT AutoActivateMode from " . $prefix . "_config"));
            $AutoActivateMode = intval($row['AutoActivateMode']);
            if ($AutoActivateMode) {
                $past = time() - 86400;
                $db->sql_query("DELETE FROM " . $user_prefix . "_users_temp WHERE time < {$past}");
                $sql = "SELECT * FROM " . $user_prefix . "_users_temp WHERE username='{$username}' AND check_num='{$check_num}'";
                $result = $db->sql_query($sql);
                if ($db->sql_numrows($result) == 1) {
                    $row = $db->sql_fetchrow($result);
                    if ($check_num == $row[check_num]) {
                        $db->sql_query("INSERT INTO " . $user_prefix . "_users (user_id, username, user_email, user_password, user_avatar, user_regdate, user_lang) VALUES (NULL, '{$row['username']}', '{$row['user_email']}', '{$row['user_password']}', 'gallery/blank.gif', '{$row['user_regdate']}', '{$language}')");
                        $db->sql_query("DELETE FROM " . $user_prefix . "_users_temp WHERE username='{$username}' AND check_num='{$check_num}'");
                        title("" . _ACTIVATIONYES . "");
                        echo "<center><b>{$row['username']}:</b> " . _ACTMSG . "</center>";
                    } else {
                        title("" . _ACTIVATIONERROR . "");
                        echo "<center>" . _ACTERROR1 . "</center>";
                    }
                } else {
                    title("" . _ACTIVATIONERROR . "");
                    echo "<center>" . _ACTERROR2 . "</center>";
                    die;
                }
            } else {
                // end - HACK: AutoActivate
                //END-OF-FIX
                $message = "" . _WELCOMETO . " {$sitename}!\n\n" . _YOUUSEDEMAIL . " ({$user_email}) " . _TOREGISTER . " {$sitename}.\n\n " . _TOFINISHUSER . "\n\n {$finishlink}\n\n " . _FOLLOWINGMEM . "\n\n" . _UNICKNAME . " {$username}\n" . _UPASSWORD . " {$user_password}";
                $subject = "" . _ACTIVATIONSUB . "";
                $from = "{$adminmail}";
                mail($user_email, $subject, $message, "From: {$from}\nX-Mailer: PHP/" . phpversion());
                title("{$sitename}: " . _USERREGLOGIN . "");
                OpenTable();
                echo "<center><b>" . _ACCOUNTCREATED . "</b><br><br>";
                echo "" . _YOUAREREGISTERED . "" . "<br><br>" . "" . _FINISHUSERCONF . "<br><br>" . "" . _THANKSUSER . " {$sitename}!</center>";
                CloseTable();
                //FIX:DOMSNITT
                // start - HACK: AutoActivate
            }
            // end - HACK: AutoActivate
            //END-OF-FIX
        }
    } else {
        echo "{$stop}";
    }
    include "footer.php";
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:84,代码来源:index.php

示例12: xoops_create_user

function xoops_create_user($username, $password, $user, $siteinfo)
{
    xoops_load("userUtility");
    global $xoopsModuleConfig, $xoopsConfig;
    if ($xoopsModuleConfig['site_user_auth'] == 1) {
        if ($ret = check_for_lock(basename(__FILE__), $username, $password)) {
            return $ret;
        }
        if (!checkright(basename(__FILE__), $username, $password)) {
            mark_for_lock(basename(__FILE__), $username, $password);
            return array('ErrNum' => 9, "ErrDesc" => 'No Permission for plug-in');
        }
    }
    return array("Username" => $username, "password" => $password, 'user' => $user, 'siteinfo' => $siteinfo);
    if ($user['passhash'] != '') {
        if ($user['passhash'] != sha1($user['time'] - $user['rand'] . $user['uname'] . $user['pass'])) {
            return array("ERRNUM" => 4, "ERRTXT" => 'No Passhash');
        }
    } else {
        return array("ERRNUM" => 4, "ERRTXT" => 'No Passhash');
    }
    foreach ($user as $k => $l) {
        ${$k} = $l;
    }
    include_once XOOPS_ROOT_PATH . '/class/auth/authfactory.php';
    include_once XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/auth.php';
    $xoopsAuth =& XoopsAuthFactory::getAuthConnection($uname);
    if (check_auth_class($xoopsAuth) == true) {
        $result = $xoopsAuth->create_user($user_viewemail, $uname, $email, $url, $actkey, $pass, $timezone_offset, $user_mailok, $siteinfo);
        return $result;
    } else {
        if (strlen(userCheck($uname, $email, $pass, $pass)) == 0) {
            global $xoopsConfig;
            $config_handler =& xoops_gethandler('config');
            $xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
            $member_handler =& xoops_gethandler('member');
            $newuser =& $member_handler->createUser();
            $newuser->setVar('user_viewemail', $user_viewemail, true);
            $newuser->setVar('uname', $uname, true);
            $newuser->setVar('email', $email, true);
            if ($url != '') {
                $newuser->setVar('url', formatURL($url), true);
            }
            $newuser->setVar('user_avatar', 'blank.gif', true);
            if (empty($actkey)) {
                $actkey = substr(md5(uniqid(mt_rand(), 1)), 0, 8);
            }
            $newuser->setVar('actkey', $actkey, true);
            $newuser->setVar('pass', md5($pass), true);
            $newuser->setVar('timezone_offset', $timezone_offset, true);
            $newuser->setVar('user_regdate', time(), true);
            $newuser->setVar('uorder', $xoopsConfig['com_order'], true);
            $newuser->setVar('umode', $xoopsConfig['com_mode'], true);
            $newuser->setVar('user_mailok', $user_mailok, true);
            $newuser->setVar('user_intrest', _US_USERREG . ' @ ' . $xoops_url, true);
            if ($xoopsConfigUser['activation_type'] == 1) {
                $newuser->setVar('level', 1, true);
            }
            if (!$member_handler->insertUser($newuser, true)) {
                $return = array('state' => 1, "text" => _US_REGISTERNG);
            } else {
                $newid = $newuser->getVar('uid');
                if (!$member_handler->addUserToGroup(XOOPS_GROUP_USERS, $newid)) {
                    $return = array('state' => 1, "text" => _US_REGISTERNG);
                }
                if ($xoopsConfigUser['activation_type'] == 1) {
                    $return = array('state' => 2, "user" => $uname);
                }
                // Sending notification email to user for self activation
                if ($xoopsConfigUser['activation_type'] == 0) {
                    $xoopsMailer =& xoops_getMailer();
                    $xoopsMailer->useMail();
                    $xoopsMailer->setTemplate('register.tpl');
                    $xoopsMailer->assign('SITENAME', $siteinfo['sitename']);
                    $xoopsMailer->assign('ADMINMAIL', $siteinfo['adminmail']);
                    $xoopsMailer->assign('SITEURL', XOOPS_URL . "/");
                    $xoopsMailer->setToUsers(new XoopsUser($newid));
                    $xoopsMailer->setFromEmail($siteinfo['adminmail']);
                    $xoopsMailer->setFromName($siteinfo['sitename']);
                    $xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $uname));
                    if (!$xoopsMailer->send()) {
                        $return = array('state' => 1, "text" => _US_YOURREGMAILNG);
                    } else {
                        $return = array('state' => 1, "text" => _US_YOURREGISTERED);
                    }
                    // Sending notification email to administrator for activation
                } elseif ($xoopsConfigUser['activation_type'] == 2) {
                    $xoopsMailer =& xoops_getMailer();
                    $xoopsMailer->useMail();
                    $xoopsMailer->setTemplate('adminactivate.tpl');
                    $xoopsMailer->assign('USERNAME', $uname);
                    $xoopsMailer->assign('USEREMAIL', $email);
                    if ($siteinfo['xoops_url'] == XOOPS_URL) {
                        $xoopsMailer->assign('USERACTLINK', $siteinfo['xoops_url'] . '/register.php?op=actv&id=' . $newid . '&actkey=' . $actkey);
                    }
                } else {
                    $xoopsMailer->assign('USERACTLINK', $siteinfo['xoops_url'] . '/register.php?op=actv&uname=' . $uname . '&actkey=' . $actkey);
                }
                $xoopsMailer->assign('SITENAME', $siteinfo['sitename']);
                $xoopsMailer->assign('ADMINMAIL', $siteinfo['adminmail']);
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:101,代码来源:xoops_create_user.php

示例13: addUser

function addUser($var)
{
    if (!pnSecConfirmAuthKey()) {
        include 'header.php';
        echo _BADAUTHKEY;
        include 'footer.php';
        exit;
    }
    list($dbconn) = pnDBGetConn();
    $pntable = pnDBGetTables();
    if (!pnSecAuthAction(0, 'Users::', $var['add_uname'] . "::", ACCESS_ADD)) {
        include 'header.php';
        echo _MODIFYUSERSADDNOAUTH;
        include 'footer.php';
        exit;
    }
    $add_pass = md5($var['add_pass']);
    if (!($var['add_uname'] && $var['add_email'] && $var['add_pass'])) {
        include "header.php";
        GraphicAdmin();
        OpenTable();
        echo "<center><font class=\"pn-title\"><b>" . _USERADMIN . "</b></font></center>";
        CloseTable();
        OpenTable();
        echo "<center><b><font class=\"pn-normal\">" . _NEEDTOCOMPLETE . "</b><br><br>" . "" . _GOBACK . "</font>";
        CloseTable();
        include "footer.php";
        return;
    }
    userCheck($var);
    if (!isset($stop)) {
        if (empty($var['add_user_viewemail'])) {
            $var['add_user_viewemail'] = 0;
        }
        $Default_Theme = pnConfigGetVar('Default_Theme');
        $commentlimit = pnConfigGetVar('commentlimit');
        $storynum = pnConfigGetVar('storyhome');
        $timezoneoffset = pnConfigGetVar('timezone_offset');
        $user_regdate = time();
        $column =& $pntable['users_column'];
        $existinguser = $dbconn->Execute("SELECT {$column['uname']} FROM {$pntable['users']} WHERE {$column['uname']}='" . $var['add_uname'] . "'");
        if (!$existinguser->EOF) {
            include 'header.php';
            echo "<div align=center><font class=\"pn-title\">" . _USEREXIST . " <a href=\"admin.php?module=NS-User&op=modifyUser&chng_uid={$var['add_uname']} \">(" . pnVarPrepForDisplay($var['add_uname']) . ") " . "</a></font></div><br>";
            echo "<font class=\"pn-normal\"><a href=\"admin.php?module=NS-User&op=main\">" . _ADDUSER . "</font></a>";
            include 'footer.php';
        } else {
            $uid = $dbconn->GenId($pntable['users']);
            $sql = "INSERT INTO {$pntable['users']} ({$column['uid']}, {$column['name']},\n\t\t\t\t\t\t {$column['uname']}, {$column['email']}, {$column['femail']}, {$column['url']},\n\t\t\t\t\t\t {$column['user_regdate']}, {$column['user_icq']}, {$column['user_aim']},\n\t\t\t\t\t\t {$column['user_yim']}, {$column['user_msnm']}, {$column['user_from']},\n\t\t\t\t\t\t {$column['user_occ']}, {$column['user_intrest']}, {$column['user_viewemail']},\n\t\t\t\t\t\t {$column['user_avatar']}, {$column['user_sig']}, {$column['pass']}, {$column['timezone_offset']})\n\t\t\t\t\t\t values (" . pnVarPrepForStore($uid) . ",'','" . $var['add_uname'] . "','" . $var['add_email'] . "','',\n\t\t\t\t\t\t '','" . pnVarPrepForStore($user_regdate) . "','','','','','','','','" . $var['add_user_viewemail'] . "','blank.gif',\n\t\t\t\t\t\t '','" . pnVarPrepForStore($add_pass) . "','" . pnVarPrepForStore($timezoneoffset) . "')";
            $result = $dbconn->Execute($sql);
            if ($dbconn->ErrorNo() != 0) {
                echo $dbconn->ErrorNo() . ": " . $dbconn->ErrorMsg() . "<br>";
                error_log("DB Error: " . $dbconn->ErrorMsg());
                return;
            }
            // Add user to group
            // get the generated id
            $uid = $dbconn->PO_Insert_ID($pntable['users'], $column['uid']);
            $column =& $pntable['groups_column'];
            $result = $dbconn->Execute("SELECT {$column['gid']} FROM {$pntable['groups']} WHERE {$column['name']}='" . pnConfigGetVar('defaultgroup') . "'");
            if ($dbconn->ErrorNo() != 0) {
                echo $dbconn->ErrorNo() . "Get default group: " . $dbconn->ErrorMsg() . "<br>";
                error_log($dbconn->ErrorNo() . "Get default group: " . $dbconn->ErrorMsg() . "<br>");
                return;
            }
            if (!$result->EOF) {
                list($gid) = $result->fields;
                $result->Close();
                $column =& $pntable['group_membership_column'];
                $result = $dbconn->Execute("INSERT INTO {$pntable['group_membership']} ({$column['gid']}, {$column['uid']}) VALUES (" . pnVarPrepForStore($gid) . ", " . pnVarPrepForStore($uid) . ")");
                if ($dbconn->ErrorNo() != 0) {
                    echo $dbconn->ErrorNo() . "Add to default group: " . $dbconn->ErrorMsg() . "<br>";
                    error_log($dbconn->ErrorNo() . "Add to default group: " . $dbconn->ErrorMsg() . "<br>");
                    return;
                }
            }
            include 'header.php';
            echo "<div align=center><font class=\"pn-title\">" . "<a href=\"admin.php?module=NS-User&op=modifyUser&chng_uid={$uid}\">" . pnVarPrepForDisplay(stripslashes($var['add_uname'])) . " (" . _USERID . " {$uid})</A> " . _ADDED . "</div></font><br>";
            echo "<font class=\"pn-normal\"><a href=\"admin.php?module=NS-User&op=main\">" . _ADDUSER . "</font></a>";
            include 'footer.php';
        }
    } else {
        echo "{$stop}";
        include 'footer.php';
    }
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:86,代码来源:admin.php

示例14: userIsAdmin

/**
 * Renvoie TRUE si l'utilisateur courant est administrateur
 */
function userIsAdmin()
{
    if (!userCheck()) {
        return false;
    }
    return userLogged()['user_is_admin'];
}
开发者ID:NiramCFPT,项目名称:m151admin_vm,代码行数:10,代码来源:functions.php

示例15: userId

<?php

require_once "model/user.php";
require_once "model/other.php";
if (isset($_POST['user']) && isset($_POST['password'])) {
    $user = $_POST['user'];
    $password = $_POST['password'];
    if (userCheck($user, $password)) {
        $_SESSION["username"] = $user;
        $_SESSION["userId"] = userId($user);
        redirect();
    } else {
        echo "login error!";
    }
} else {
    require_once "views/login.php";
}
开发者ID:apacska,项目名称:learn,代码行数:17,代码来源:login.php


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