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


PHP log_user函数代码示例

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


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

示例1: pwg_login

/**
 * Default method for user login, can be overwritten with 'try_log_user' trigger.
 * @see try_log_user()
 *
 * @param string $username
 * @param string $password
 * @param bool $remember_me
 * @return bool
 */
function pwg_login($success, $username, $password, $remember_me)
{
    if ($success === true) {
        return true;
    }
    // we force the session table to be clean
    pwg_session_gc();
    global $conf;
    // retrieving the encrypted password of the login submitted
    $query = '
SELECT ' . $conf['user_fields']['id'] . ' AS id,
       ' . $conf['user_fields']['password'] . ' AS password
  FROM ' . USERS_TABLE . '
  WHERE ' . $conf['user_fields']['username'] . ' = \'' . pwg_db_real_escape_string($username) . '\'
;';
    $row = pwg_db_fetch_assoc(pwg_query($query));
    if (isset($row['id']) and $conf['password_verify']($password, $row['password'], $row['id'])) {
        log_user($row['id'], $remember_me);
        trigger_notify('login_success', stripslashes($username));
        return true;
    }
    trigger_notify('login_failure', stripslashes($username));
    return false;
}
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:33,代码来源:functions_user.inc.php

示例2: Report

 public function Report()
 {
     // Logging
     log_user($this->Session['username'], 'Heeft een bug gemeld.');
     // Send error
     $this->email->from('tjoosten3@gmail.com', 'Tim Joosten');
     $this->email->to('topairy@gmail.com');
     $this->email->subject($this->input->post('Title'));
     $this->email->message($this->input->post('Body'));
     $this->email->send();
     // For debugging proposes
     // echo $this->email->print_debugger();
 }
开发者ID:SIJOT,项目名称:SIJOT-1.x,代码行数:13,代码来源:Issue.php

示例3: get_theme_info

require "../../php_includes/cmaster.inc";
$cTheme = get_theme_info();
std_theme_styles(1);
std_theme_body();
$iid = (int) $_GET["id"];
$ccrc = $_GET["crc"];
$r1 = pg_safe_exec("SELECT * FROM pending_passwordchanges WHERE cookie='" . post2db($ccrc) . "' AND user_id='" . $iid . "'");
if ($o1 = @pg_fetch_object($r1, 0)) {
    if ($ccrc == md5($iid . "modFP" . CRC_SALT_0015 . $o1->new_crypt)) {
        // confirmation of password change
        $rez = @pg_safe_exec("UPDATE users SET password='" . $o1->new_crypt . "',last_updated=now()::abstime::int4,last_updated_by='forgotten password (" . cl_ip() . ")' WHERE id='" . $iid . "'");
        if ($rez) {
            $ru = pg_safe_exec("SELECT * FROM users WHERE id='" . $iid . "'");
            $user = pg_fetch_object($ru, 0);
            mail($user->email, $mail_subject_pass . $user->user_name, "Your Cservice password is: " . $o1->new_clrpass . "\nRemember it!", "From: " . $mail_from_pass . "\nReply-To: " . $mail_from_pass . "\nX-Mailer: " . NETWORK_NAME . " Channel Service");
            log_user($user->id, 9, " [manual confirmation]");
            pg_safe_exec("DELETE FROM pending_passwordchanges WHERE user_id='" . $user->id . "'");
            echo "<h1>Success !<br><br>\n";
            echo "Password change has been approved successfully for user '" . $user->user_name . "'</h1>\n";
            echo "</body></html>\n\n";
            die;
        } else {
            echo "<h1>Error<br><br>\n";
            echo "Unknown SQL Error !</h1>\n";
            echo "</body></html>\n\n";
            die;
        }
    } else {
        echo "<h1>Error<br><br>\n";
        echo "Invalid credentials !</h1>\n";
        echo "</body></html>\n\n";
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:31,代码来源:cfp.php

示例4: mail

                        $mm .= "\n";
                        $mm .= "CANCEL_URL = " . $a_URL . "\n";
                        $mm .= "\n";
                        $mm .= "-------------------------\n\n";
                        $doconf = 1;
                        mail(CONFIRM_STAR_PWRESET_MAIL, $ss, $mm, "From: Channel Service <no.reply@cservice.undernet.org>\nX-Mailer: CSC-1.1\n\n");
                    }
                }
            }
        }
        if (!$doconf || LOCK_ON_PWCHG) {
            $res = pg_safe_exec("update users set password='" . $crypt . "', " . " last_updated = now()::abstime::int4, " . " last_updated_by = 'forgotten password (" . cl_ip() . ")' " . " where " . "  id='" . $user->id . "'");
        }
        if ($res && !$doconf) {
            mail($user->email, $mail_subject_pass . $user->user_name, "Your Cservice password is: " . $password . "\nRemember it!", "From: " . $mail_from_pass . "\nReply-To: " . $mail_from_pass . "\nX-Mailer: " . NETWORK_NAME . " Channel Service");
            log_user($user->id, 9, " ");
        }
        pg_safe_exec("delete from lastrequests where ip='" . cl_ip() . "'");
        pg_safe_exec("insert into lastrequests (ip,last_request_ts) values ('" . cl_ip() . "',now()::abstime::int4)");
        ?>
<html>
<head><title>Request Successful</title></head>
<?php 
        std_theme_body();
        if ($doconf) {
            echo "Your new password is pending CService's approval, You will be notified.<br>\n";
            if (LOCK_ON_PWCHG) {
                echo "Your account is locked out until the new password is approved (or not).<br>\n";
            } else {
                echo "Your old password remains active until the new one has been approved.<br>\n";
            }
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:31,代码来源:forgotten_pass.php

示例5: l10n

            $page['errors'][] = l10n('Password confirmation is missing. Please confirm the chosen password.');
        } else {
            if ($_POST['password'] != $_POST['password_conf']) {
                $page['errors'][] = l10n('The passwords do not match');
            }
        }
    }
    register_user($_POST['login'], $_POST['password'], $_POST['mail_address'], true, $page['errors'], isset($_POST['send_password_by_mail']));
    if (count($page['errors']) == 0) {
        // email notification
        if (isset($_POST['send_password_by_mail']) and email_check_format($_POST['mail_address'])) {
            $_SESSION['page_infos'][] = l10n('Successfully registered, you will soon receive an email with your connection settings. Welcome!');
        }
        // log user and redirect
        $user_id = get_userid($_POST['login']);
        log_user($user_id, false);
        redirect(make_index_url());
    }
    $registration_post_key = get_ephemeral_key(2);
} else {
    $registration_post_key = get_ephemeral_key(6);
}
$login = !empty($_POST['login']) ? htmlspecialchars(stripslashes($_POST['login'])) : '';
$email = !empty($_POST['mail_address']) ? htmlspecialchars(stripslashes($_POST['mail_address'])) : '';
//----------------------------------------------------- template initialization
//
// Start output of page
//
$title = l10n('Registration');
$page['body_id'] = 'theRegisterPage';
$template->set_filenames(array('register' => 'register.tpl'));
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:31,代码来源:register.php

示例6: complaints_threads

                 echo "<a href=\"admin.php\">Back to Complaint Admin</a><br><br>\n";
             }
             break;
         case 'delete':
             $q = "UPDATE complaints SET status=99,created_crc='',crc_expiration=(now()::abstime::int4+(86400*15)) WHERE id='" . (int) $da_id . "' AND ticket_number='" . $_GET["ID"] . "'";
             $q2 = "INSERT INTO complaints_threads (complaint_ref,reply_by,reply_ts,reply_text,actions_text,in_reply_to) VALUES ('" . (int) $da_id . "'," . (int) $user_id . ",now()::abstime::int4,'** TICKET REMOVED/DELETED **','',0)";
             $q3 = "DELETE FROM complaints_reference WHERE complaints_ref='" . (int) $da_id . "'";
             $r = pg_safe_exec($q);
             $updated = 0;
             if ($r) {
                 $r2 = pg_safe_exec($q2);
                 if ($r2) {
                     $updated = 1;
                     pg_safe_exec($q3);
                     if ($daobj->from_id > 0) {
                         log_user($daobj->from_id, 12, "Ticket-number: " . $_GET["ID"] . " (removed by admin)");
                     }
                 }
             }
             if ($updated) {
                 echo "<br><br><b>This complaint ticket has been removed. The user is NOT being notified of this fact.</b><br><br>";
                 echo "<a href=\"admin.php\">Back to Complaint Admin</a><br><br>\n";
             } else {
                 echo "<br><br><b>For some strange reason, we couldn't remove this ticket, please contact a Site Administrator.</b><br><br>";
                 echo "<a href=\"admin.php\">Back to Complaint Admin</a><br><br>\n";
             }
             break;
     }
 } else {
     echo "<br><br>This message has already been replied to.";
 }
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:31,代码来源:ticket.php

示例7: print_r

        print_r(htmlentities($wh_result));
        echo "[WH_RESULT_END]<BR>";
        echo "[WH_RESULT_INFO=]";
        print_r(curl_getinfo($wh_curl));
        echo "[WH_RESULT_INFO_END]";
    }
    // DEBUG
    // webhook set?
    if ($wh_info['http_code'] != '201' && $wh_info['http_code'] != '204') {
        $WARNINGS .= '[webhook not set]';
        log_error("3.2 webhook not set. result=[" . print_r($wh_result, TRUE) . "]");
    }
}
// ** 4. log what happened
// date/time user orcid statuscode warnings
log_user();
if ($status == 0) {
    add_to_IDM();
}
// looks good. add to queue to update campus IDM system
?>
</pre>

<!-- header -->
<table width="700px;"><tr>
<td><h2><A HREF='../'>ORCID-webapp</A><BR> ORCID ID Created</h2></td>
<td style="width:200px;"><img src="../images/Corp-comp-OP-logo16-0.jpg" width="80%"></td>
<td style="width:200px;"></td>
</tr>
</table>
开发者ID:CMU-Lib,项目名称:orcid-webapp,代码行数:30,代码来源:create_done.php

示例8: pg_safe_exec

     $omail = $email->old_email;
     $res = pg_safe_exec("select id from users where id!={$userid} AND lower(email)='" . strtolower($nmail) . "'");
     if (pg_numrows($res) > 0) {
         std_theme_styles(1);
         std_theme_body("../");
         echo "<h1>Error</h1>";
         echo "An account with that e-mail is already known.  Please choose another.";
         echo "</body></html>";
         pg_safe_exec("delete from pending_emailchange where cookie='{$ID}'");
         exit;
     }
 }
 // change email
 $res = pg_safe_exec("UPDATE users SET email='{$nmail}',last_updated=now()::abstime::int4,last_updated_by='Email-in-record Modification' WHERE id='{$userid}'");
 $user_id = $userid;
 log_user($userid, 7, "Changed email-in-record from: {$omail} (old) to: {$nmail} (new) - cookie was: {$ID}");
 $user_id = 0;
 if ($res) {
     $res = pg_safe_exec("delete from pending_emailchanges where cookie='{$ID}'");
     echo "<html><head><title>Successful E-Mail Change</title>";
     std_theme_styles();
     echo "</head>";
     std_theme_body("../");
     echo "<h1>Success!</h1>";
     echo "Your account has a new email-in-record :<br>\n";
     echo "<center><table><tr><td><h1>" . $nmail . "</h1></td></tr></table></center>";
     echo "You may now proceed to the <a href=\"../index.php\" target=_top>Main page</a>.<br>";
     echo "</body></html>";
     exit;
 } else {
     // First check to see if somebody got there first.
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:31,代码来源:confirm_emailchange.php

示例9: std_init

<?php

/* $Id: admin_user_comment.php,v 1.2 2003/03/31 06:59:36 nighty Exp $ */
include "../../php_includes/cmaster.inc";
std_init();
if ($admin < 600) {
    echo "You don't have access.";
    die;
}
if ($spcmode == "remove" && $admin < 800) {
    echo "You don't have access.";
    die;
}
if ($spcmode == "remove") {
    $rr = pg_safe_exec("SELECT COUNT(*) AS count FROM userlog WHERE user_id='" . $uid . "' AND ts='" . $ts . "' AND event=5");
    if ($rr) {
        $oo = pg_fetch_object($rr);
        if ($oo->count == 1) {
            pg_safe_exec("DELETE FROM userlog WHERE user_id='" . $uid . "' AND ts='" . $ts . "' AND event=5");
        }
    }
} else {
    log_user($uid, 5, $admcmt);
}
header("Location: users.php?id={$uid}");
die;
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:26,代码来源:admin_user_comment.php

示例10: header

<?php

header('Access-Control-Allow-Origin: *');
require_once "log_func.php";
$username = null;
$text = null;
try {
    if (isset($_REQUEST['username'])) {
        $username = $_REQUEST['username'];
    } else {
        throw new Exception('ERROR NO USERNAME SPECIFIED.');
    }
    if (isset($_REQUEST['text'])) {
        $text = $_REQUEST['text'];
    } else {
        throw new Exception('ERROR NO TEXT SPECIFIED.');
    }
    log_user($username, $text);
} catch (Exception $e) {
    echo $e->getMessage();
}
开发者ID:piter65,项目名称:spilldec,代码行数:21,代码来源:log.php

示例11: ajax_content_page

function ajax_content_page() {
  global $user;  
  $statuses = statuses_retrieve();
  
  // Display graph
  print_graph();
  // FB API placeholder
  echo "<div id='fb-root'></div>";
  // Display karma index
  print_karma($statuses);
  
  print <<<EOS
<div id="nav-buttons">  
<input type="button" value="Your most popular statuses" class="uibutton tab-main confirm" id="tab-pop" />
<input type="button" value="Your oldest statuses" class="uibutton tab-main" id="tab-oldest" />
<input type="button" value="All your statuses" class="uibutton tab-main" id="tab-allstatus" />
<input type="button" value="Most popular friends" class="uibutton tab-main" id="tab-topuser" />
</div>  
EOS;
  print '<div class="main-tab-member" id="tab-pop-content">';
  // Display the most popular status
  print_most_popular($statuses);  
  print '</div><div class="main-tab-member" id="tab-oldest-content">';
  // Display the oldest status
  print_oldest($statuses);
  print '</div><div class="main-tab-member" id="tab-allstatus-content">';
  // Display all statuses
  print_statuses($statuses);
  print '</div><div class="main-tab-member" id="tab-topuser-content">';
  
  // I know this is ugly, but data for new users needs to be inserted to the cache before printing out the leaderboard...
  if (!empty($user)) {
    log_user($user);
  }
  
  print_leaderboard(TRUE, 5);
  print_leaderboard(FALSE, 10);
  print '</div>';
  
  print theme_links();
  //$pics = pics_retrieve();
  //print_pics($pics);
  
}
开发者ID:ryandao,项目名称:Facebook-Status-Time-Capsule,代码行数:44,代码来源:index.php

示例12: log_user

}
// ------------------------------------------------------------------
// ------------------------------------------------------------------
// user tries to login
// ------------------------------------------------------------------
if (isset($_POST['login']) && isset($_POST['pass'])) {
    log_user($_POST['login'], $_POST['pass']);
    if (isset($_POST['cookie'])) {
        set_cookie();
    }
}
// ------------------------------------------------------------------
// user wants to logout (?logout $_GET var)
// ------------------------------------------------------------------
if (isset($_GET['deconnexion']) || isset($_GET['logout'])) {
    log_user('dis', 'connect');
}
// ------------------------------------------------------------------
// ------------------------------------------------------------------
// if here, there's no login/logout process.
// Check referrer, ip
// session duration...
// on problem, out !
// ------------------------------------------------------------------
if (!is_ok()) {
    session_destroy();
    if (!$auto_restrict['just_die_if_not_logged']) {
        include 'login_form.php';
    } else {
        echo $auto_restrict['error_msg'];
    }
开发者ID:AlainRnet,项目名称:BoZoN,代码行数:31,代码来源:auto_restrict.php

示例13: cache_clear

######################################################################
# admin login/deco
######################################################################
if (isset($_POST['login']) && isset($_POST['pass'])) {
    cache_clear();
    log_user($_POST['login'], $_POST['pass']);
} else {
    if (isset($_POST['pass'])) {
        log_user($config['login'], $_POST['pass']);
    }
}
// logme with the bookmarklet form
$admin = is_ok();
if (isset($_POST['exit'])) {
    inlog('User disconnected');
    log_user("", "");
}
# config change
######################################################################
if ($admin && isset($_POST['app_name'])) {
    inlog('Configuration changed');
    if ($config['data_file'] != $_POST['data_file'] && !is_file($_POST['data_file'])) {
        backup_datafile();
        rename($config['data_file'], $_POST['data_file']);
    }
    // rename if .dat filename has changed
    if ($config['log_filename'] != $_POST['log_filename'] && !is_file($_POST['log_filename'])) {
        rename($config['log_filename'], $_POST['log_filename']);
        file_put_contents('.htaccess', "<Files " . $_POST['log_filename'] . ">\n\tOrder deny,allow\n\tDeny from all\n</Files>");
    }
    // renaming log file
开发者ID:ArthurHoaro,项目名称:SnippetVamp,代码行数:31,代码来源:index.php

示例14: gdLineByLineToAssoc

     $txt .= $add;
     //print($txt); exit;
     //}
     $result = gdLineByLineToAssoc($txt);
     $journal_notes_ommitted = strpos($txt, 'journal_notes') !== false && !isset($result['journal_notes']);
     $week_db = (int) $rs_gameload_json->fields("week");
     $playernum_db = (int) $rs_gameload_json->fields("class") - 2;
     $playernum_db = max($playernum_db, 1);
     $week_isset = isset($result["week"]);
     $week_data = $result["week"];
     $week_not_equal = $week_data != $week_db;
     // Catch if 'journal_notes' got deleted.
     if ($journal_notes_ommitted) {
         log_user($username, "BX_ERROR: GAME DATA LOAD DECTECTED ISSUE: 'journal_notes' field was ommited when the data blob was decoded.");
         log_user($username, "DATA_BLOB:\n{$txt}");
         log_user($username, "ARRAY_DATA:\n" . var_export($result, true));
     }
     // BChance: Ensure that the game load has the correct week.
     if (!$week_isset || $week_not_equal) {
         $result["week"] = $week_db;
         $result["week_changed"] = true;
     }
     $result["playernum"] = $playernum_db;
     $result["php_week_isset"] = $week_isset;
     $result["php_week_not_equal"] = $week_not_equal;
     $result["php_week_data"] = $week_data;
     $result["php_week_db"] = $week_db;
     $result["php_data_length"] = $game_data_length;
     $result["journal_notes_ommitted"] = $journal_notes_ommitted;
     echo json_encode($result);
 } else {
开发者ID:piter65,项目名称:spilldec,代码行数:31,代码来源:auth.php

示例15: pg_safe_exec

     echo "and make sure it is correct</h1><a href=\"confirm_pwreset.php\">Try again.</a>";
     echo "</body></html>";
     exit;
 } else {
     pg_safe_exec("delete from pending_pwreset where expiration<now()::abstime::int4");
     $pwreset = pg_fetch_object($res, 0);
     $userid = $pwreset->user_id;
     $qid = $pwreset->question_id;
     $vdata = $pwreset->verificationdata;
 }
 // change verifdata
 $gor = pg_safe_exec("SELECT verificationdata FROM users WHERE id='" . (int) $userid . "'");
 $goro = pg_fetch_object($gor);
 $res = pg_safe_exec("UPDATE users SET question_id='" . (int) $qid . "',verificationdata='" . post2db($vdata) . "',post_forms=(now()::abstime::int4+86400*10),last_updated=now()::abstime::int4,last_updated_by='Verif Q/A Reset' WHERE id='" . (int) $userid . "'");
 $user_id = $userid;
 log_user($userid, 8, "Cookie was: " . $ID . ", Old V/A was: " . $goro->verificationdata);
 $user_id = 0;
 if ($res) {
     $res = pg_safe_exec("delete from pending_pwreset where cookie='" . $ID . "'");
     echo "<html><head><title>Successful Verificiation Question/Answer Reset</title>";
     std_theme_styles();
     echo "</head>";
     std_theme_body("../");
     echo "<h1>Success!</h1>";
     echo "Your account verification question/answer has been changed !<br>\n";
     echo "<br><br>";
     echo "You may now proceed to the <a href=\"../index.php\" target=_top>Main page</a>.<br>";
     echo "</body></html>";
     exit;
 } else {
     echo "<html><head><title>An Error Occured</title>";
开发者ID:Shadowss,项目名称:gnuworld-website,代码行数:31,代码来源:confirm_pwreset.php


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