• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP userLoggedIn函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: customerFields

function customerFields($data, $badFields)
{
    global $states;
    global $COUNTRIES;
    if (userLoggedIn() && array_key_exists("CID", $data) && $data["CID"] != "") {
        tableRow(array(tableData(prompt("<b>CID:</b>"), "right", "top"), tableData(prompt($data["CID"]), "left", "top")));
        prepDatePicker();
        tableRow(array(tableData(prompt("<b>Met Date:</b>"), "right", "top"), tableData(text($data, "metDate", "", "", "datepicker"), "left", "middle")));
    }
    tableRow(array(tableData(prompt("<b>First name*:</b>", in_array("fname", $badFields)), "right"), tableData(text($data, "fname"), "left", "middle"), tableData(prompt("<b>Last name*:</b>", in_array("lname", $badFields)), "right"), tableData(text($data, "lname"), "left", "middle")));
    tableRow(array(tableData(prompt("<b>Email*:</b>", in_array("email", $badFields)), "right"), tableData(text($data, "email"), "left", "middle"), tableData(prompt("<b>Phone Number:</b>", in_array("phoneNum", $badFields)), "right"), tableData(text($data, "phoneNum"), "left", "middle")));
    tableRow(array(tableData(prompt("<b>Title:</b>", in_array("title", $badFields)), "right"), tableData(radioButton($data, "title", "Mr.", false, "Mr."), "center", "middle"), tableData(radioButton($data, "title", "Ms.", false, "Ms."), "center", "middle"), tableData(radioButton($data, "title", "Mrs.", false, "Mrs."), "center", "middle"), tableData(radioButton($data, "title", "Dr.", false, "Dr."), "center", "middle")));
    if (!userLoggedIn()) {
        if ($data["charity"] == true) {
            tableRow(array(tableData(prompt("Tell us about your situtation, your team and why you need a ChapR. The more information the better!"), "middle", "top", 6)));
        } else {
            tableRow(array(tableData(prompt("Write anything else you would like us to know about you below: <br> team info (type, name, number), how you heard about us (where, from who?) etc."), "middle", "top", 6)));
        }
    }
    tableRow(array(tableData(prompt("<b>Comments:</b>", in_array("customerCNotes", $badFields), ""), "right", "top"), tableData(textArea($data, "customerCNotes", 3), "center", "", 5)));
    tableRow(array(tableData(prompt("<b>Street1*:</b>", in_array("street1", $badFields)), "right"), tableData(text($data, "street1"), "left", "middle", 3)));
    tableRow(array(tableData(prompt("<b>Street2:</b>", in_array("street2", $badFields)), "right"), tableData(text($data, "street2"), "left", "middle", 3)));
    $stateDirections = 'only applicable for domestic teams';
    tableRow(array(tableData(prompt("<b>City*:</b>", in_array("city", $badFields)), "right"), tableData(text($data, "city"), "left", "middle"), tableData(prompt("<b>State*:</b>", in_array("state", $badFields), "", $stateDirections), "right"), tableData(dropDown($data, "state", $states, "--------Choose Your State-------"), "left", "middle")));
    tableRow(array(tableData(prompt("<b>Zip*:</b>", in_array("zip", $badFields)), "right"), tableData(text($data, "zip"), "left", "middle"), tableData(prompt("<b>Country:</b>", in_array("country", $badFields)), "right"), tableData(dropDown($data, "country", $COUNTRIES), "left", "middle")));
    if (userLoggedIn()) {
        tableRow(array(tableData(prompt("<b>Admin Comments:</b>", in_array("adminCNotes", $badFields), "", $commentDirections), "right", "top"), tableData(textArea($data, "adminCNotes", 3), "center", "", 5)));
    }
    tableRow(array(tableData(hiddenField("CID", $data["CID"])), tableData(hiddenField("OID", $data["OID"]))));
}
开发者ID:ChapResearch,项目名称:Online-Orders-Database,代码行数:30,代码来源:customerForm.php


示例2: checkUserLoggedIn

function checkUserLoggedIn()
{
    if (!userLoggedIn()) {
        echo "<h2>You must be logged in to use this function. ";
        switch (rand(0, 5)) {
            case 0:
                echo "Press the BACK button and log in!  or else...\n";
                break;
            case 1:
                echo "Press the BACK button and login, or just go away.</h2>";
                break;
            case 2:
                echo "Press the BACK button and login, or Ben will come after you.</h2>";
                break;
            case 3:
                echo "Press the BACK button and login, or Rachel may get mad at you.</h2>";
                break;
            case 4:
                echo "Press the BACK button and login, pretty please....</h2>";
                break;
            case 5:
                echo "Press the BACK button and login, or don't, or do,...</h2>";
                break;
        }
        exit(1);
    }
}
开发者ID:ChapResearch,项目名称:Online-Orders-Database,代码行数:27,代码来源:user.php


示例3: postReply

 public function postReply()
 {
     $validation = new Validator();
     $errors = $validation->isValid(Replies::$rules);
     if (sizeof($errors) > 0) {
         flash('errors', $errors);
         redirect($_SESSION['current_page']);
     }
     $data = ['topic_id' => $_POST['topic_id'], 'user_id' => userLoggedIn()->id, 'body' => strip_tags($_POST['body'])];
     if (Replies::create($data)) {
         flash('success', ['reply added successfully']);
         redirect($_SESSION['current_page']);
     }
 }
开发者ID:marious,项目名称:talkingspace_forum,代码行数:14,代码来源:TopicController.php


示例4: doHeader

function doHeader($title, $county)
{
    echo '<div id="main_header">';
    echo '<img id="logo" src="images/cnty_logo.png" height="98" alt="Home">';
    echo '<h1 id="Company">' . $county . '</h1>';
    echo '<h1 id="Application">' . $title . 's</h1>';
    if (userLoggedIn()) {
        echo '<div id="user_nav">';
        echo '<ul>';
        echo '	    <li><a href="userProfile.php">Profile</a></li>';
        echo '	    <li><a href="includes/logout.php">Log out</a></li>';
        echo '</ul>';
        echo '</div>';
    }
    echo '</div>';
}
开发者ID:urisk,项目名称:cssServiceRequests,代码行数:16,代码来源:header.php


示例5: the_whatpage_theme

function the_whatpage_theme()
{
    global $globals, $mysql, $theme, $done, $error, $errors;
    global $user, $privs, $row;
    global $q, $q1;
    global $endpage_msg;
    error_handler($errors);
    //error_handler($endpage_msg);
    error_handler($endpage_msg);
    if (!userLoggedIn()) {
        return false;
    }
    if (!empty($errors) || !empty($endpage_msg)) {
        return false;
    }
    //		isAllowedTo();
    echo '<center>';
    echo '<h1>What?</h1>';
    echo '<h2>Which page is this, huh?</h2>';
    echo '<h3>Which page did you want, hunh!!!</h3>';
    echo '<h3>Redirecting you to the index page, lol :P :)</h3>';
    //echo '<h3>Awrite Cowboy, redirecting you to the index page, :P lol :)</h3>';
    echo '</center>';
}
开发者ID:ashish2,项目名称:resumer,代码行数:24,代码来源:the_whatpage_theme.php


示例6: getConnection

<?php

if ($_GET["comp"] != '') {
    $comp = $_GET["comp"];
}
if ($_POST["comp"] != '') {
    $comp = $_POST["comp"];
}
require_once "./includes/applicationheader.php";
include "./languages/" . $_SP_language . "/invoke_chat.php";
$conn = getConnection();
if (userLoggedIn() && $_SESSION["sess_clientchatid"] != '') {
    /*$sql = "select vUserName from sptbl_users where nUserId = '".$_SESSION["sess_userid"]."'";
      $result = executeSelect($sql,$conn);
      if(mysql_num_rows($result) > 0) {
         while($row = mysql_fetch_array($result)) {
    		$username = $row["vUserName"];
    	 }
      }*/
    $username = $_SESSION["sess_userfullname"];
    header("location:client_chat.php?username=" . $username . "&comp=" . $comp);
}
/*Newly added on 190609*/
$sql = "Select vLookUpName,vLookUpValue from sptbl_lookup WHERE vLookUpName IN('LangChoice',\n          'DefaultLang','HelpdeskTitle','Logourl','logactivity','MaxPostsPerPage','OldestMessageFirst', 'PostTicketBeforeLogin','SMTPSettings','SMTPServer','SMTPPort')";
$rs = executeSelect($sql, $conn);
if (!isset($_SESSION['sess_cssurl'])) {
    $_SESSION['sess_cssurl'] = "styles/coolgreen.css";
}
if (mysql_num_rows($rs) > 0) {
    while ($row = mysql_fetch_array($rs)) {
        switch ($row["vLookUpName"]) {
开发者ID:kevinsmasters,项目名称:purecatskillsmarketplace,代码行数:31,代码来源:invoke_chat.php


示例7: orderFields

function orderFields($data, $badFields)
{
    global $SETTINGS;
    // display data not supposed to be visible for customers
    if (userLoggedIn()) {
        if (array_key_exists("OID", $data) && $data["OID"] != "") {
            tableRow(array(tableData(prompt("<b>OID: </b>"), "right", "top"), tableData(prompt($data["OID"]), "left", "top")));
        }
        tableRow(array(tableData(prompt("<b>Expedite:</b>"), "right", "top"), tableData(checkBox($data, "isExpedited", "true", "YES"), "left", "middle", 3)));
        prepDatePicker();
        tableRow(array(tableData(prompt("<b>Ordered Date:</b>"), "right", "top"), tableData(text($data, "orderedDate", "", "", "datepicker"), "left", "middle")));
    }
    // show the order amount change fields if the user has permission (and in WordPress)
    if (inWordPress() && current_user_can("can_change_amounts")) {
        tableRow(array(tableData(prompt("<b>Shipping Fee:</b>", in_array("shippingFee", $badFields)), "right"), tableData(text($data, "shippingFee", null, "10"), "left"), tableData(prompt("<b>Expedite Fee:</b>", in_array("expediteFee", $badFields)), "right"), tableData(text($data, "expediteFee", null, "10"), "left"), tableData(prompt("<b>Discount:</b>", in_array("discount", $badFields)), "right"), tableData(text($data, "discount", null, "10"), "left")));
    }
    // figure out how many rows to display initially ($i is set to that value)
    for ($i = $SETTINGS["MaxItems"]; $i > 1; $i--) {
        if (array_key_exists("packages{$i}", $data) && $data["packages{$i}"] != "" && $data["packages{$i}"] != 0 || array_key_exists("personality{$i}", $data) && $data["personality{$i}"] != "" && $data["personality{$i}"] != 0 || array_key_exists("quantity{$i}", $data) && $data["quantity{$i}"] != "" && $data["quantity{$i}"] != 0) {
            break;
        }
    }
    $initialRows = $i;
    // get currently available packages (from database) for display
    $rows = dbGetPackages();
    $displayPackages = array();
    foreach ($rows as $row) {
        if ($row["Active"]) {
            $displayPackages[$row["PackageName"]] = $row["PKID"];
        }
    }
    // get currently available personalities (from database) for display
    $rows = dbGetPersonalities();
    $displayPersonalities = array();
    foreach ($rows as $row) {
        if ($row["Active"]) {
            $displayPersonalities[$row["PieceName"]] = $row["PID"];
        }
    }
    if (!userLoggedIn()) {
        tableRow(array(tableData(prompt("Note: \"personality\" refers to the type of software or platform the firmware is compatible with.\n<br> It can be changed later using a USB stick, but we might as well set it for you."), "middle", "top", 6)));
    }
    for ($i = 1; $i <= $SETTINGS["MaxItems"]; $i++) {
        // note that the "table-row" setting for display is controversial and may
        // not work well in Microsoft IE
        // note, too, that the reason while rows 2 through 5 don't initially display
        // is that they are set as display = 'none' in the style sheet - if that
        // is turned off, then they will display right away
        $magicClick = "";
        if ($i != $SETTINGS["MaxItems"]) {
            $magicClick = "<button id=\"prodrowclick-";
            $magicClick .= $i;
            $magicClick .= "\"";
            if ($i != $initialRows) {
                $magicClick .= " style=\"visibility:hidden;\"";
            }
            $magicClick .= " type=\"button\" onclick=\"";
            $magicClick .= "document.getElementById('prodrow-";
            $magicClick .= $i + 1;
            // sets the next row to visible
            $magicClick .= "').style.display = 'table-row';";
            if ($i < $SETTINGS["MaxItems"] - 1) {
                $magicClick .= "document.getElementById('prodrowclick-";
                $magicClick .= $i + 1;
                // sets the next button to visible
                $magicClick .= "').style.visibility = 'visible';";
            }
            $magicClick .= "document.getElementById('prodrowclick-";
            $magicClick .= $i;
            // sets its own button to hidden
            $magicClick .= "').style.visibility = 'hidden';";
            $magicClick .= "\">+</button>";
        }
        if (userLoggedIn() && array_key_exists("iid{$i}", $data) && $data["IID"] != "") {
            tableRow(array(tableData(prompt("<b>IID{$i}:</b>"), "right", "top"), tableData(prompt($data["iid{$i}"]), "left", "top")));
        }
        tableRow(array(tableData(prompt("<b>Product*:</b>", in_array("product{$i}", $badFields)), "right"), tableData(dropDown($data, "packages{$i}", $displayPackages, "----------Select Product----------")), tableData(prompt("<b>Personality:</b>", in_array("personality{$i}", $badFields)), "right"), tableData(dropDown($data, "personality{$i}", $displayPersonalities, " ")), tableData(prompt("<b>Quantity*:</b>", in_array("quantity{$i}", $badFields)), "right"), tableData(text($data, "quantity{$i}", "", "2"), "left"), tableData($magicClick)), "prodrow-" . $i, $i <= $initialRows);
        hiddenField("iid{$i}", $data["iid{$i}"]);
    }
    if (!userLoggedIn()) {
        tableRow(array(tableData(prompt("Write anything you would like us to know about the order: <br> a deadline you need to meet, some option you want that isn't offered etc."), "middle", "top", 6)));
    }
    tableRow(array(tableData(prompt("<b>Order Notes:</b>"), "right", "top"), tableData(textArea($data, "customerONotes", 5), "left", "", 5)));
    if (userLoggedIn()) {
        tableRow(array(tableData(prompt("<b>Admin Order Notes:</b>"), "right", "top"), tableData(textArea($data, "adminONotes", 5), "left", "", 5)));
    }
    hiddenField("charity", $data["charity"]);
    hiddenField("OID", $data["OID"]);
}
开发者ID:ChapResearch,项目名称:Online-Orders-Database,代码行数:89,代码来源:orderForm.php


示例8: modifyprofile_theme

function modifyprofile_theme()
{
    global $globals, $mysql, $theme, $done, $error, $errors;
    global $user, $privs, $row;
    global $q, $qe, $l;
    error_handler($errors);
    if (!empty($errors)) {
        return false;
    }
    if (!userLoggedIn()) {
        return false;
    }
    //		isAllowedTo();
    $cssThClassNm = 'class="dt-header"';
    $cssTrClassNm = 'class="dth-wp_post-tr"';
    $cssTdClassNm = 'class="dth-wp_post"';
    echo '
		<form method="post" action="">
			<table class="disp_table" id="disp_table" align="center" width="100%">
				<tr ' . $cssTrClassNm . '>
					<td ' . $cssTdClassNm . '>' . $l['usrnm'] . '</td>
					<td ' . $cssTdClassNm . '>' . $row['username'] . '</td>
				</tr>
				<tr ' . $cssTrClassNm . '>
					<td ' . $cssTdClassNm . '>' . $l['abt'] . '</td>
					<td ' . $cssTdClassNm . '><textarea name="about" rows="7" cols="40">' . $row['about'] . '</textarea></td>
				</tr>
				<tr ' . $cssTrClassNm . '>
					<td ' . $cssTdClassNm . '>' . $l['dob'] . '</td>
					<td ' . $cssTdClassNm . '><input type="text" name="dob" value=' . $row['dob'] . '></td>
				</tr>
				<tr ' . $cssTrClassNm . '>
					<td ' . $cssTdClassNm . '>' . $l['dp_url'] . '</td>
					<td ' . $cssTdClassNm . '><input type="text" name="display_pic_url" value=' . $row['display_pic_url'] . '></td>
				</tr>
				<tr ' . $cssTrClassNm . '>
					<td ' . $cssTdClassNm . '>' . $l['fav_perf'] . '</td>
					<td ' . $cssTdClassNm . '><input type="text" name="perfume" value=' . $row['perfume'] . '></td>
				</tr>
				<tr ' . $cssTrClassNm . '>
					<td ' . $cssTdClassNm . 'width="50%">' . $l['dp_nm'] . '</td>
					<td ' . $cssTdClassNm . '><input type="text" name="display_name" value=' . $row['display_name'] . '></td>
				</tr>' . '<tr ' . $cssTrClassNm . '>
					<td ' . $cssTdClassNm . '>' . $l['email'] . '</td>
					<td ' . $cssTdClassNm . '>' . $row['email'] . '</td>
				</tr>
				<tr ' . $cssTrClassNm . '>
					<td ' . $cssTdClassNm . 'width="50%">' . $l['web_url'] . '</td>
					<td ' . $cssTdClassNm . '><input type="text" name="url" value=' . $row['url'] . '></td>
				</tr>
				<tr ' . $cssTrClassNm . '>
					<td ' . $cssTdClassNm . '>' . $l['sex'] . '</td>
					<td ' . $cssTdClassNm . '>
						<select name="sex">';
    $options = array("" => "Select", "m" => "Male", "f" => "Female", "o" => "Special");
    $ht = "";
    foreach ($options as $k => $v) {
        $sel = $k == $row['sex'] ? "selected" : "";
        $ht .= "<option value='{$k}' {$sel}>{$v}</option>";
    }
    echo $ht . '
						</select>
					</td>
				</tr>
			</table>
			<br />
			<br />
			<center>
				<input class="mun-button-default" type="submit" id="modprof" name="modprof" value="Modify Profile">
			</center>
		</form>
	';
}
开发者ID:ashish2,项目名称:resumer,代码行数:73,代码来源:modifyprofile_theme.php


示例9: churchcal_main

/**
 * ChurchTools 2.0
 * http://www.churchtools.de
 *
 * Copyright (c) 2014 Jens Martin Rauen
 * Licensed under the MIT license, located in LICENSE.txt
 *
 * ChurchCal Module
 * Depends on ChurchCore
 */
function churchcal_main()
{
    global $config, $base_url, $config, $embedded;
    drupal_add_css(ASSETS . '/fullcalendar/fullcalendar.css');
    if (isset($_GET["printview"])) {
        drupal_add_css(ASSETS . '/fullcalendar/fullcalendar.print.css');
    }
    drupal_add_css(ASSETS . '/simplecolorpicker/jquery.simplecolorpicker.css');
    drupal_add_js(ASSETS . '/simplecolorpicker/jquery.simplecolorpicker.js');
    drupal_add_js(ASSETS . '/fullcalendar/moment.min.js');
    drupal_add_js(ASSETS . '/fullcalendar/fullcalendar.min.js');
    drupal_add_js(CHURCHCORE . '/cc_events.js');
    drupal_add_js(CHURCHCORE . '/cc_abstractview.js');
    drupal_add_js(CHURCHCORE . '/cc_standardview.js');
    drupal_add_js(CHURCHCORE . '/cc_maintainstandardview.js');
    drupal_add_js(CHURCHCAL . '/eventview.js');
    drupal_add_js(CHURCHCAL . '/yearview.js');
    drupal_add_js(CHURCHCAL . '/calendar.js');
    drupal_add_js(CHURCHCAL . '/cal_sources.js');
    drupal_add_js(createI18nFile("churchcore"));
    drupal_add_js(createI18nFile("churchcal"));
    $txt = '';
    if ($catId = getVar("category_id")) {
        include_once CHURCHCAL . '/churchcal_db.php';
        $auth = churchcal_getAuthForAjax();
        $perm = true;
        foreach (explode(",", $catId) as $id) {
            // Check permission, perhaps show login mask
            if (empty($auth["view category"]) || empty($auth["view category"][$id])) {
                $perm = false;
            }
        }
        if (!$perm) {
            include_once MAIN . '/login.php';
            $login = login_main();
            if (!userLoggedIn()) {
                return $login;
            }
        }
        $txt .= '<input type="hidden" id="filtercategory_id" name="category_id" value="' . $catId . '"/>' . NL;
        if ($id = getVar("id")) {
            // only of category_id is set
            $txt .= '<input type="hidden" id="filterevent_id" name="id" value="' . $id . '"/>' . NL;
        }
    }
    if (getVar("printview")) {
        $txt .= '<input type="hidden" id="printview" value="true"/>';
        $embedded = true;
    }
    if ($embedded) {
        if ($catSel = getVar("category_select")) {
            $txt .= '<input type="hidden" id="filtercategory_select" name="category_select" value="' . $catSel . '"/>' . NL;
        }
        if ($cssUrl = getVar("cssurl")) {
            drupal_add_css($cssUrl);
        }
        // if (getConf("churchcal_css", "-") != "-") $txt .= '<style>' . getConf("churchcal_css") . '</style>'; //TODO: is
        // the '-' important?
        if ($css = getConf("churchcal_css")) {
            $txt .= "<style>{$css}</style>" . NL;
        }
        if (getVar("minical")) {
            $txt .= '<input type="hidden" id="isminical"/>';
        }
        $txt .= '
        <div class="row-fluid">
          <div id="cdb_filter"></div>
        </div>
        <div id="cdb_content"><div id="calendar"></div></div>
    ';
        if (getVar("embedded")) {
            $txt .= '<input type="hidden" id="isembedded"/>';
        }
        if ($t = getVar("title")) {
            $txt .= '<input type="hidden" id="embeddedtitle" value="' . $t . '"/>';
        }
        if ($e = getVar("entries")) {
            $txt .= '<input type="hidden" id="entries" value="' . $e . '"/>';
        }
        if ($s = getVar("startdate")) {
            $txt .= '<input type="hidden" id="init_startdate" value="' . $s . '"/>';
        }
        if ($e = getVar("enddate")) {
            $txt .= '<input type="hidden" id="init_enddate" value="' . $e . '"/>';
        }
    } else {
        $txt .= '
      <div class="row-fluid">
    <div class="span3"><div id="cdb_filter"></div></div>
    <div class="span9"><div id="header" class="pull-right"></div><div id="cdb_content"><div id="calendar"></div></div></div>
//.........这里部分代码省略.........
开发者ID:toXel,项目名称:churchtools_basic,代码行数:101,代码来源:churchcal.php


示例10: delete_suggestion

	function delete_suggestion(){
		global $conn;
		
		$tablename = $_GET['tableName'];
		$suggestion_id = $_GET['suggestion_id'];
		$token = $_GET['jwt'];
		
		
		
		//we dont have to worry about checking what the result is, as as soon as it realizes we arent logged in 401 response header sent and caight by HTTP interceptor
		userLoggedIn($token);
		flush();
		
		
		$accepted_tables = get_tables();
		if(in_array($tablename, $accepted_tables)){
			$tablename = htmlspecialchars($tablename);
			$suggestion_id = htmlspecialchars($suggestion_id);
			if($sql = $conn->prepare("DELETE FROM $tablename WHERE suggestion_id = ?")){
				$sql->bind_param('s', $suggestion_id);
				if( !($sql->execute()) ){
					echo false;
				}
			}
		}

		
	}
开发者ID:ericalas93,项目名称:whatdoyouwannado,代码行数:28,代码来源:suggestions.php


示例11:

<?php

$router->map('GET', '/', 'App\\controllers\\HomeController@showIndex', 'home');
$router->map('POST', '/', 'App\\controllers\\AuthenticationController@postLogin', 'login');
$router->map('GET', '/topics', 'App\\controllers\\TopicController@showTopics', 'topics');
$router->map('GET', '/topics/category/[:action]', 'App\\controllers\\TopicController@showCategoryTopics', 'categoryTopics');
$router->map('GET', '/topic/[i:id]', 'App\\controllers\\TopicController@showTopic', 'topic');
if (userLoggedIn() != false) {
    $router->map('GET', '/logout', 'App\\controllers\\AuthenticationController@logout', 'logout');
    $router->map('GET', '/topic/create', 'App\\controllers\\TopicController@showcreateTopic', 'createTopic');
    $router->map('POST', '/topic/create', 'App\\controllers\\TopicController@postCreateTopic', 'postcreateTopic');
    $router->map('POST', '/topic/[i:id]', 'App\\controllers\\TopicController@postReply', 'postReply');
}
if (userLoggedIn() == false) {
    $router->map('GET', '/register', 'App\\controllers\\RegisterController@showRegister', 'register');
    $router->map('POST', '/register', 'App\\controllers\\RegisterController@postRegister', 'postRegister');
    $router->map('GET', '/captcha', 'App\\controllers\\HomeController@showCaptcha');
}
开发者ID:marious,项目名称:talkingspace_forum,代码行数:18,代码来源:routes.php


示例12: login_main

function login_main()
{
    global $q, $config;
    $txt = "";
    if (isset($config["admin_message"]) && $config["admin_message"] != "") {
        addErrorMessage($config["admin_message"]);
    }
    if (isset($_GET["message"]) && $_GET["message"] != "") {
        addInfoMessage($_GET["message"]);
    }
    // Sicherstellen, dass keiner eingelogt ist!
    if (!userLoggedIn()) {
        if (isset($config["login_message"])) {
            addInfoMessage($config["login_message"], true);
        }
        $model = new CTForm("LoginForm", "prooveLogin", "Login");
        $model->setHeader(t("login.headline"), t("please.fill.following.fields"));
        $model->addField("email", "", "INPUT_REQUIRED", t("email.or.username"), true);
        $model->addField("password", "", "PASSWORD", t("password"));
        if (!isset($config["show_remember_me"]) || $config["show_remember_me"] == 1) {
            $model->addField("rememberMe", "", "CHECKBOX", t("remember.me"));
        }
        $model->addButton(t("login"), "ok");
        if (isset($_GET["newpwd"])) {
            $res = db_query("select count(*) c from {cdb_person} where email='" . $_GET["email"] . "' and archiv_yn=0")->fetch();
            if ($_GET["email"] == "" || $res->c == 0) {
                $txt .= '<div class="alert alert-error"><p>Bitte ein g&uuml;ltige EMail-Adresse angeben, 
          an die das neue Passwort gesendet werden kann! 
          Diese Adresse muss im System schon eingerichtet sein.
          <p>Falls die E-Mail-Adresse schon eingerichtet sein sollte, 
          wende Dich bitte an <a href="' . variable_get("site_mail") . '">' . variable_get("site_mail") . '</a>.</div>';
            } else {
                $newpwd = random_string(8);
                $scrambled_password = scramble_password($newpwd);
                db_query("update {cdb_person} set password='" . $scrambled_password . "' where email='" . $_GET["email"] . "'");
                $content = "<h3>Hallo!</h3><p>Ein neues Passwort wurde f&uuml;r die E-Mail-Adresse <i>" . $_GET["email"] . "</i> angefordert: {$newpwd}";
                churchcore_systemmail($_GET["email"], "[" . variable_get('site_name') . "] Neues Passwort", $content, true, 1);
                churchcore_sendMails(1);
                $txt .= '<div class="alert alert-info">Hinweis: Ein neues Passwort wurde nun an <i>' . $_GET["email"] . '</i> gesendet.</div>';
                ct_log("Neues Passwort angefordert " . $_GET["email"], 2, "-1", "login");
            }
        } else {
            if (isset($_POST["email"]) && isset($_POST["password"]) && isset($_POST["directtool"])) {
                include_once CHURCHCORE . "/churchcore_db.php";
                $sql = "select * from {cdb_person} where email=:email and active_yn=1 and archiv_yn=0";
                $res = db_query($sql, array(":email" => $_POST["email"]))->fetch();
                if ($res == false) {
                    drupal_json_output(jsend()->fail("Unbekannte E-Mail-Adresse"));
                } else {
                    if (user_check_password($_POST["password"], $res)) {
                        login_user($res);
                        ct_log("Login durch Direct-Tool " . $_POST["directtool"] . " mit " . $_POST["email"], 2, "-1", "login");
                        drupal_json_output(jsend()->success());
                    } else {
                        drupal_json_output(jsend()->fail("Falsches Passwort"));
                    }
                }
                return;
            } else {
                if (isset($_GET["loginstr"]) && $_GET["loginstr"] != "" && isset($_GET["id"])) {
                    // L�sche alte cc_loginurrls die �lter sind als 14 tage
                    db_query("delete from {cc_loginstr} where DATEDIFF( current_date, create_date ) > 13");
                    $sql = "select * from {cc_loginstr} where loginstr=:loginstr and person_id=:id";
                    $res = db_query($sql, array(":loginstr" => $_GET["loginstr"], ":id" => $_GET["id"]))->fetch();
                    if ($res == false) {
                        $txt .= '<div class="alert alert-info">Fehler: Der verwendete Login-Link ist nicht mehr aktuell und kann deshalb nicht mehr verwendet werden. Bitte mit E-Mail-Adresse und Passwort anmelden!</div>';
                    } else {
                        // Nehme den LoginStr heraus, damit er nicht mi�braucht werden kann.
                        $sql = "delete from {cc_loginstr} where loginstr=:loginstr and person_id=:id";
                        $res = db_query($sql, array(":loginstr" => $_GET["loginstr"], ":id" => $_GET["id"]));
                        ct_log("Login User " . $_GET["id"] . " erfolgreich mit loginstr ", 2, "-1", "login");
                        $res = churchcore_getPersonById($_GET["id"]);
                        login_user($res);
                    }
                }
            }
        }
        $txt .= $model->render();
        $txt .= '<script>jQuery("#newpwd").click(function(k,a) {
         if (confirm("' . t('want.to.receive.new.password') . '")) {
           window.location.href="?newpwd=true&email="+jQuery("#LoginForm_email").val()+"&q=' . $q . '";
            }
          });</script>';
    } else {
        // Wenn man sich ummelden m�chte und zur Familie geh�rt (also gleiche E-Mail-Adresse)
        if (isset($_GET["family_id"])) {
            if (isset($_SESSION["family"][$_GET["family_id"]])) {
                //logout_current_user();
                login_user($_SESSION["family"][$_GET["family_id"]]);
                $txt .= '<div class="alert alert-info">Ummelden erfolgreich! Du arbeitest nun mit der Berechtigung von ' . $_SESSION["user"]->vorname . ' ' . $_SESSION["user"]->name . '.</div>';
            } else {
                $txt .= '<div class="alert alert-info">Ummelden zu Id:' . $_GET["family_id"] . ' hat nicht funktioniert, Session ist leer!</div>';
            }
        } else {
            $txt .= '<div class="alert alert-info"><i>Hinweis:</i> Du bist angemeldet als ' . $_SESSION["user"]->vorname . ', weiter geht es <a href="?q=home">hier</a>!</div>';
        }
    }
    return $txt;
}
开发者ID:lhaselauer,项目名称:churchtools_basic,代码行数:99,代码来源:login.php


示例13: login_main

/**
 * main function for login
 * @return string
 */
function login_main()
{
    global $q, $config, $user;
    $txt = "";
    if ($t = getConf("admin_message")) {
        addErrorMessage($t);
    }
    if ($t = getVar("message")) {
        addInfoMessage($t);
    }
    // Sicherstellen, dass keiner eingelogt ist!
    if (!userLoggedIn()) {
        if ($t = getVar("login_message")) {
            addInfoMessage($t, true);
        }
        $form = new CTForm("LoginForm", "validateLogin", "Login");
        $form->setHeader(t("login.headline"), t("please.fill.following.fields"));
        $form->addField("email", "", "INPUT_REQUIRED", t("email.or.username"), true);
        if (getVar("email")) {
            $form->fields["email"]->setValue(getVar("email"));
        }
        $form->addField("password", "", "PASSWORD", t("password"));
        // TODO: when is this false?
        if (getConf("show_remember_me", 1) == 1) {
            $form->addField("rememberMe", "", "CHECKBOX", t("remember.me"));
        }
        $form->addButton(t("login"), "ok");
        // access through externale tools through GET and additional direct
        // POST so no GET is used , so it is not visible in the URL
        if (getVar("email", false, $_POST) && getVar("password", false, $_POST) && getVar("directtool", false, $_POST)) {
            include_once CHURCHCORE . "/churchcore_db.php";
            $email = getVar("email", false, $_POST);
            $password = getVar("password", false, $_POST);
            $directTool = getVar("directtool", false, $_POST);
            $res = db_query("SELECT * FROM {cdb_person}\n                       WHERE email=:email AND active_yn=1 AND archiv_yn=0", array(":email" => $email))->fetch();
            if (!$res) {
                drupal_json_output(jsend()->fail(t('email.unknown')));
            } else {
                if (user_check_password($password, $res)) {
                    login_user($res, null, false);
                    ct_log("Login by Direct-Tool {$directTool} with {$email}", 2, "-1", "login");
                    drupal_json_output(jsend()->success());
                } else {
                    drupal_json_output(jsend()->fail(t('wrong.password')));
                }
            }
            return;
        } else {
            if (($loginstr = getVar("loginstr")) && ($id = getVar('id'))) {
                // delete login strings older then 14 days
                db_query("DELETE FROM {cc_loginstr}\n                WHERE DATEDIFF( current_date, create_date ) > 13");
                $res = db_query("SELECT * FROM {cc_loginstr}\n                       WHERE loginstr=:loginstr AND person_id=:id", array(":loginstr" => $loginstr, ":id" => $id))->fetch();
                if (!$res) {
                    $txt .= '<div class="alert alert-info">' . t('login.string.too.old') . '</div>';
                } else {
                    // delete current loginKey to prevent misuse
                    $res = db_query("DELETE FROM {cc_loginstr}\n                         WHERE loginstr=:loginstr AND person_id=:id", array(":loginstr" => $loginstr, ":id" => $id));
                    ct_log("Login User {$id} erfolgreich mit loginstr ", 2, "-1", "login");
                    $res = churchcore_getPersonById($id);
                    login_user($res);
                }
            }
        }
        $txt .= $form->render();
        $txt .= '<script>jQuery("#newpwd").click(function(k,a) {
         if (confirm("' . t('want.to.receive.new.password') . '")) {
           window.location.href="?q=login/newpwd&email="+jQuery("#LoginForm_email").val();
            }
          });</script>';
    } else {
        // switch to another family user (same email)
        if ($familyId = getVar("family_id")) {
            if (isset($_SESSION["family"][$familyId])) {
                // logout_current_user();
                login_user($_SESSION["family"][$familyId]);
                $txt .= '<div class="alert alert-info">' . t('user.succesfully.changed.now.you.work.with.permissions.of.x', $_SESSION["user"]->vorname . ' ' . $_SESSION["user"]->name) . '</div>';
            } else {
                $txt .= "<div class='alert alert-info'>" . t('user.change.to.familyX.failed.session.is.empty', $familyId) . "</div>";
            }
        } else {
            if (getVar("directtool", false, $_POST)) {
                drupal_json_output(jsend()->success("Already logged in"));
            } else {
                $txt .= '<div class="alert alert-info">' . t('you.are.logged.in.as.x.click.y.to.continue', $_SESSION["user"]->vorname, '<a href="?q=home">' . t('home') . '</a>') . '</div>';
            }
        }
    }
    return $txt;
}
开发者ID:toXel,项目名称:churchtools_basic,代码行数:93,代码来源:login.php


示例14: the_endpage_theme

function the_endpage_theme()
{
    global $globals, $mysql, $theme, $done, $error, $errors;
    global $user, $privs, $row;
    global $q, $q1;
    global $endpage_msg;
    error_handler($errors);
    //error_handler($endpage_msg);
    error_handler($endpage_msg);
    if (!userLoggedIn()) {
        return false;
    }
    if (!empty($errors) || !empty($endpage_msg)) {
        return false;
    }
    //		isAllowedTo();
    echo '
		<form method="post" action="">
			<table align="center" width="100%" border="1">
				<tr>
					<td>Username</td>
					<td>' . $row['username'] . '</td>
				</tr>
				<tr>
					<td>About</td>
					<td><textarea name="about" rows="7" cols="40">' . $row['about'] . '</textarea></td>
				</tr>
				<tr>
					<td>DOB</td>
					<td><input type="text" name="dob" value=' . $row['dob'] . '></td>
				</tr>
				<tr>
					<td>Display Pic Url</td>
					<td><input type="text" name="display_pic_url" value=' . $row['display_pic_url'] . '></td>
				</tr>
				<tr>
					<td>Fave Perfume</td>
					<td><input type="text" name="perfume" value=' . $row['perfume'] . '></td>
				</tr>
				<tr>
					<td width="50%"> DisplayName </td>
					<td><input type="text" name="display_name" value=' . $row['display_name'] . '></td>
				</tr>' . '<tr>
					<td>Email </td>
					<td>' . $row['email'] . '</td>
				</tr>
				<tr>
					<td width="50%">Web URL</td>
					<td><input type="text" name="url" value=' . $row['url'] . '></td>
				</tr>
				<tr>
					<td>Sex</td>
					<td>
						<select name="sex">';
    $options = array("" => "Select", "m" => "Male", "f" => "Female", "o" => "Special");
    $ht = "";
    foreach ($options as $k => $v) {
        $sel = $k == $row['sex'] ? "selected" : "";
        $ht .= "<option value='{$k}' {$sel}>{$v}</option>";
    }
    echo $ht . '
						</select>
					</td>
				</tr>
			</table>
			<br />
			<br />
			<center>
				<input type="submit" id="modprof" name="modprof" value="Modify Profile">
			</center>
		</form>
	';
}
开发者ID:ashish2,项目名称:resumer,代码行数:73,代码来源:the_endpage_theme.php


示例15: userLoggedIn

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP userLogin函数代码示例发布时间:2022-05-23
下一篇:
PHP userIdExists函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap