本文整理汇总了PHP中activity_log函数的典型用法代码示例。如果您正苦于以下问题:PHP activity_log函数的具体用法?PHP activity_log怎么用?PHP activity_log使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了activity_log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activity_log_install
function activity_log_install()
{
global $wpdb;
global $activity_log_db_version;
$table_name = $wpdb->prefix . "activity_log";
if ($wpdb->get_var("show tables like '{$table_name}'") != $table_name) {
$sql = "CREATE TABLE " . $table_name . " (\n\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\ttime bigint(11) DEFAULT '0' NOT NULL,\n\t\t\ttype tinytext NOT NULL,\n\t\t\tentry text NOT NULL,\n\t\t\tUNIQUE KEY id (id)\n\t\t);";
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
dbDelta($sql);
add_option("activity_log_db_version", $activity_log_db_version);
}
$rows_affected = activity_log(array('type' => 'admin', 'entry' => 'Activity Log plugin activated'));
}
示例2: authenticate
/**
* Authenticate
*
* Checks if the user has a valid username and password by:
* 1) Checking for proper authentication from UIowa, and
* 2) Checking if the user is allowed to use this site
*
* @author David Dellsperger
* @author Sean Ephraim
* @access public
* @param array Array of variables to use
* @return mixed Username on success, else FALSE
*/
public function authenticate($vars = NULL)
{
if (isset($_GET['uip_ticket'])) {
$uip_ticket = $_GET['uip_ticket'];
$url = "https://login.uiowa.edu/uip/checkticket.page?service=" . $this->auth_URL . "&uip_ticket=" . $uip_ticket;
$rsp = file_get_contents($url);
$rsp = str_replace("\n", '&', $rsp);
parse_str($rsp);
// Get the HawkID (username) from the response
if (!isset($error)) {
$this->load->library('ion_auth');
if ($this->ion_auth->username_check($hawkid)) {
// Valid user!
$this->load->model('auth_model');
if ($this->auth_model->force_login($hawkid)) {
// login successful!
$user = $this->ion_auth->user()->row();
// Who should the welcome message be addressed to?
if ($user->first_name) {
$name = $user->first_name;
} else {
$name = $user->username;
}
// Set welcome message
if ($name) {
$this->session->set_flashdata('success', 'Welcome, ' . $name . '!');
} else {
$this->session->set_flashdata('success', 'Welcome!');
}
// Log the login!
$username = $user->username;
activity_log("User '{$username}' logged in", 'login');
redirect('variations/unreleased');
} else {
// ERROR: could not login
$this->session->set_flashdata('error', 'There was an error logging in. Please try again.');
}
} else {
// ERROR: non-registered user of this site
$this->session->set_flashdata('error', 'You are not registered to use this site.');
}
} else {
// ERROR: UI login tools returned an error
$this->session->set_flashdata('error', "There was an error logging in: '{$error}'");
}
// Redirect to local login if an error occurred
redirect('login');
}
// Redirect to the UIowa login page
redirect('https://login.uiowa.edu/uip/login.page?service=' . $this->auth_URL);
}
示例3: dbi_free_result
if ($event_owner == $login || user_is_assistant($login, $event_owner)) {
$can_delete = true;
}
}
dbi_free_result($res);
}
}
if (empty($error) && !$can_delete) {
$error = print_not_auth(6);
}
if (empty($error) && $can_delete) {
if (!dbi_execute('DELETE FROM webcal_blob WHERE cal_blob_id = ?', array($blid))) {
$error = db_error();
} else {
if ($event_id > 0) {
$removeStr = translate('Removed');
if ($type == 'A') {
activity_log($event_id, $login, $login, LOG_ATTACHMENT, $removeStr . ': ' . $name);
} elseif ($type == 'C') {
activity_log($event_id, $login, $login, LOG_COMMENT, $removeStr);
}
}
if ($event_id > 0) {
do_redirect('view_entry.php?id=' . $event_id);
}
do_redirect(get_preferred_view());
}
}
// Some kind of error...
print_header();
echo print_error($error) . print_trailer();
示例4: translate
}
$msg .= " " . $login_fullname . ". " . translate("The subject is") . " \"" . $name . "\"\n\n" . translate("The description is") . " \"" . $description . "\"\n" . translate("Date") . ": " . date_to_str($fmtdate) . "\n" . (empty($user_hour) && empty($minute) ? "" : translate("Time") . ": " . display_time($user_hour * 10000 + $minute * 100, true) . "\n") . translate("Please look on") . " " . translate($application_name) . " " . ($require_approvals == "Y" ? translate("to accept or reject this appointment") : translate("to view this appointment")) . ".";
// add URL to event, if we can figure it out
/*
if ( ! empty ( $server_url ) ) {
$url = $server_url . "view_entry.php?id=" . $id;
$msg .= "\n\n" . $url;
}
*/
if (strlen($from)) {
$extra_hdrs = "From: {$from}\r\nX-Mailer: " . translate($application_name);
} else {
$extra_hdrs = "X-Mailer: " . translate($application_name);
}
mail($tempemail, translate($application_name) . " " . translate("Notification") . ": " . $name, utf8_decode(html_to_8bits($msg)), $extra_hdrs);
activity_log($id, $login, $participants[$i], $LOG_NOTIFICATION, "");
}
}
}
}
// add external participants
// send notification if enabled.
if (is_array($ext_names) && is_array($ext_emails)) {
for ($i = 0; $i < count($ext_names); $i++) {
if (strlen($ext_names[$i])) {
$sql = "INSERT INTO webcal_entry_ext_user " . "( cal_id, cal_fullname, cal_email ) VALUES ( " . "{$id}, '{$ext_names[$i]}', ";
if (strlen($ext_emails[$i])) {
$sql .= "'{$ext_emails[$i]}' )";
} else {
$sql .= "NULL )";
}
示例5: send_reminder
//.........这里部分代码省略.........
}
// This will allow date functions to use the proper TIMEZONE.
set_env('TZ', $user_TIMEZONE);
$useHtml = !empty($htmlmail[$user]) ? 'Y' : 'N';
$padding = !empty($htmlmail[$user]) ? ' ' : ' ';
$body = str_replace('XXX', $is_task ? translate('task') : translate('event'), translate('This is a reminder for the XXX detailed below.')) . "\n\n";
$create_by = $row[0];
$event_time = date_to_epoch($row[1] . ($row[2] != -1 ? sprintf("%06d", $row[2]) : ''));
$name = $row[9];
$description = $row[10];
// Add trailing '/' if not found in server_url.
// Don't include link for External users.
if (!empty($SERVER_URL) && !$isExt) {
$eventURL = $SERVER_URL . (substr($SERVER_URL, -1, 1) == '/' ? '' : '/') . 'view_entry.php?id=' . $id . '&em=1';
if ($useHtml == 'Y') {
$eventURL = activate_urls($eventURL);
}
$body .= $eventURL . "\n\n";
}
$body .= strtoupper($name) . "\n\n" . translate('Description') . ":\n" . $padding . $description . "\n" . ($is_task ? translate('Start Date') : translate('Date')) . ': ' . date_to_str($row[2] > 0 ? date('Ymd', $event_date) : gmdate('Ymd', $event_date)) . "\n" . ($row[2] > 0 ? ($is_task ? translate('Start Time') : translate('Time')) . ': ' . display_time('', $display_tzid, $event_time, $userTformat) . "\n" : ($row[2] == 0 && ($row[5] = 1440) ? translate('Time') . ': ' . translate('All day event') . "\n" : '')) . ($row[5] > 0 && !$is_task ? translate('Duration') . ': ' . $row[5] . ' ' . translate('minutes') . "\n" : ($is_task ? translate('Due Date') . ': ' . date_to_str($row[11]) . "\n" . translate('Due Time') . ': ' . display_time($row[12], $display_tzid, '', $userTformat) . "\n" : '')) . ($is_task && isset($percentage[$user]) ? translate('Pecentage Complete') . ': ' . $percentage[$user] . "%\n" : '') . (empty($DISABLE_PRIORITY_FIELD) || $DISABLE_PRIORITY_FIELD != 'Y' ? translate('Priority') . ': ' . $row[6] . '-' . $pri[ceil($row[6] / 3)] . "\n" : '');
if (empty($DISABLE_ACCESS_FIELD) || $DISABLE_ACCESS_FIELD != 'Y') {
$body .= translate('Access') . ': ';
if ($row[8] == 'C') {
$body .= translate('Confidential') . "\n";
} elseif ($row[8] == 'P') {
$body .= translate('Public') . "\n";
} elseif ($row[8] == 'R') {
$body .= translate('Private') . "\n";
}
}
$body .= (!empty($single_user_login) && !$single_user_login ? translate('Created by') . ': ' . $row[0] . "\n" : '') . translate('Updated') . ': ' . date_to_str($row[3]) . ' ' . display_time($row[3] . sprintf("%06d", $row[4]), $display_tzid, '', $userTformat) . "\n";
// Site extra fields.
$extras = get_site_extra_fields($id);
$site_extracnt = count($site_extras);
for ($i = 0; $i < $site_extracnt; $i++) {
if ($site_extras[$i] == 'FIELDSET') {
continue;
}
$extra_name = $site_extras[$i][0];
$extra_descr = $site_extras[$i][1];
$extra_type = $site_extras[$i][2];
$extra_arg1 = $site_extras[$i][3];
$extra_arg2 = $site_extras[$i][4];
if (!empty($site_extras[$i][5])) {
$extra_view = $site_extras[$i][5] & EXTRA_DISPLAY_REMINDER;
}
if (!empty($extras[$extra_name]['cal_name']) && $extras[$extra_name]['cal_name'] != '' && !empty($extra_view)) {
$val = '';
$body .= $extra_descr;
if ($extra_type == EXTRA_DATE) {
$body .= ': ' . $extras[$extra_name]['cal_date'] . "\n";
} elseif ($extra_type == EXTRA_MULTILINETEXT) {
$body .= "\n" . $padding . $extras[$extra_name]['cal_data'] . "\n";
} elseif ($extra_type == EXTRA_RADIO) {
$body .= ': ' . $extra_arg1[$extras[$extra_name]['cal_data']] . "\n";
} else {
// Default method for EXTRA_URL, EXTRA_TEXT, etc...
$body .= ': ' . $extras[$extra_name]['cal_data'] . "\n";
}
}
}
if ((empty($single_user) || $single_user != 'Y') && (empty($DISABLE_PARTICIPANTS_FIELD) || $DISABLE_PARTICIPANTS_FIELD != 'N')) {
$body .= translate('Participants') . ":\n";
for ($i = 0; $i < $partcnt; $i++) {
$body .= $padding . $names[$participants[$i]] . "\n";
}
for ($i = 0; $i < $ext_partcnt; $i++) {
$body .= $padding . $ext_participants[$i] . ' ( ' . translate('External User') . ")\n";
}
}
$subject = translate('Reminder') . ': ' . stripslashes($name);
if ($debug) {
echo "Sending mail to {$recip} (in {$userlang}).<br />\n";
}
if ($only_testing) {
if ($debug) {
echo '<hr />
<pre>
To: ' . $recip . '
Subject: ' . $subject . '
From:' . $adminStr . '
' . $body . '
</pre>
';
}
} else {
$mail = new WebCalMailer();
user_load_variables($user, 'temp');
$recipName = $isExt ? $user : $GLOBALS['tempfullname'];
// Send ics attachment to External Users or
// or users who explicitly chose to receive it.
$attach = $isExt || isset($attachics[$user]) ? $id : '';
$mail->WC_Send($adminStr, $recip, $recipName, $subject, $body, $useHtml, $GLOBALS['EMAIL_FALLBACK_FROM'], $attach);
$cal_text = ($isExt ? translate('External User') : '') . $recipName;
activity_log($id, 'system', $user, LOG_REMINDER, $cal_text);
}
}
}
示例6: user_add_user
// This error should get caught before here anyhow,
// so no need to translate this. This is just in case. :-)
$error = 'Invalid characters in login.';
} else {
if (empty($user)) {
// Username cannot be blank. This is currently the only place
// that calls addUser that is located in $user_inc.
$error = $blankUserStr;
} else {
user_add_user($user, $upassword1, $ufirstname, $ulastname, $uemail, $uis_admin, $u_enabled);
activity_log(0, $login, $user, LOG_USER_ADD, "{$ufirstname} {$ulastname}" . (empty($uemail) ? '' : " <{$uemail}>"));
}
}
}
} else {
if (!empty($add) && !access_can_access_function(ACCESS_USER_MANAGEMENT)) {
$error = print_not_auth(15);
} else {
// Don't allow a user to change themself to an admin by setting
// uis_admin in the URL by hand. They must be admin beforehand.
if (!$is_admin) {
$uis_admin = 'N';
}
user_update_user($user, $ufirstname, $ulastname, $uemail, $uis_admin, $uenabled);
activity_log(0, $login, $user, LOG_USER_UPDATE, "{$ufirstname} {$ulastname}" . (empty($uemail) ? '' : " <{$uemail}>"));
}
}
}
}
}
echo error_check('users.php', false);
示例7: SetCookie
// logged in) if $REMEMBER_LAST_LOGIN is set to "Y" (in admin.php).
if (!empty($remember) && $remember == 'yes') {
SetCookie('webcalendar_login', $login, time() + 24 * 3600 * 365, $cookie_path);
} else {
SetCookie('webcalendar_login', $login, 0, $cookie_path);
}
if (!empty($GLOBALS['newUserUrl'])) {
$url = $GLOBALS['newUserUrl'];
}
do_redirect($url);
} else {
// Invalid login
if (empty($error) || !$showLoginFailureReason) {
$error = translate('Invalid login', true);
}
activity_log(0, 'system', '', LOG_LOGIN_FAILURE, translate('Username') . ": " . $login . ", IP: " . $_SERVER['REMOTE_ADDR']);
}
} else {
// No login info... just present empty login page
//$error = "Start";
}
// delete current user
SetCookie('webcalendar_session', '', 0, $cookie_path);
// In older versions the cookie path had no trailing slash and NS 4.78
// thinks "path/" and "path" are different, so the line above does not
// delete the "old" cookie. This prohibits the login. So we delete the
// cookie with the trailing slash removed
if (substr($cookie_path, -1) == '/') {
SetCookie('webcalendar_session', '', 0, substr($cookie_path, 0, -1));
}
}
示例8: reset_language
if ($send_user_mail == "Y" && strlen($tempemail) && $send_email != "N") {
if ($GLOBALS['LANGUAGE'] != $user_language && !empty($user_language) && $user_language != 'none') {
reset_language($user_language);
}
$msg = translate("Hello") . ", " . $tempfullname . ".\n\n" . translate("An appointment has been rejected by") . " " . $login_fullname . ". " . translate("The subject was") . " \"" . $name . " \"\n" . translate("The description is") . " \"" . $description . "\"\n" . translate("Date") . ": " . date_to_str($fmtdate) . "\n" . (empty($hour) && empty($minute) ? "" : translate("Time") . ": " . display_time($hour * 10000 + $minute * 100)) . "\n\n\n";
if (!empty($server_url)) {
$url = $server_url . "view_entry.php?id=" . $id;
$msg .= "\n\n" . $url;
}
$from = $email_fallback_from;
if (strlen($login_email)) {
$from = $login_email;
}
$extra_hdrs = "From: {$from}\r\nX-Mailer: " . translate("Title");
mail($tempemail, translate($application_name) . " " . translate("Notification") . ": " . $name, html_to_8bits($msg), $extra_hdrs);
activity_log($id, $login, $partlogin[$i], $LOG_NOTIFICATION, "Event rejected by {$app_user}");
}
}
}
if (empty($error)) {
if ($ret == "list") {
do_redirect("list_unapproved.php?user={$app_user}");
} else {
do_redirect("view_entry.php?id={$id}&user={$app_user}");
}
exit;
}
print_header();
echo "<h2>" . translate("Error") . "</h2>\n";
echo "<p>" . $error . "</p>\n";
print_trailer();
示例9: print_not_auth
if ($is_admin || $my_event || $can_edit && $is_assistant || access_is_enabled() && access_user_calendar('edit', $user)) {
$del_user = $user;
} else {
// Error: user cannot delete from other user's calendar.
$error = print_not_auth(6);
}
}
if (empty($error)) {
if ($override_repeat) {
dbi_execute('INSERT INTO webcal_entry_repeats_not
( cal_id, cal_date, cal_exdate ) VALUES ( ?, ?, ? )', array($id, $date, 1));
// Should we log this to the activity log???
} else {
dbi_execute('UPDATE webcal_entry_user SET cal_status = ?
WHERE cal_id = ? AND cal_login = ?', array('D', $id, $del_user));
activity_log($id, $login, $login, $log_reject, '');
}
}
}
}
$ret = getValue('ret');
$return_view = get_last_view();
if (!empty($ret)) {
if ($ret == 'listall') {
$url = 'list_unapproved.php';
} else {
if ($ret == 'list') {
$url = 'list_unapproved.php' . (empty($user) ? '' : '?user=' . $user);
}
}
} else {
示例10: load_user_preferences
load_user_preferences();
load_user_layers();
load_user_categories();
include "includes/translate.php";
$error = "";
// Allow administrators to approve public events
if ($public_access == "Y" && !empty($public) && $is_admin) {
$app_user = "__public__";
} else {
$app_user = $login;
}
if ($id > 0) {
if (!dbi_query("UPDATE webcal_entry_user SET cal_status = 'A' " . "WHERE cal_login = '{$app_user}' AND cal_id = {$id}")) {
$error = translate("Error approving event") . ": " . dbi_error();
} else {
activity_log($id, $login, $app_user, $LOG_APPROVE, "");
}
// Update any extension events related to this one.
$res = dbi_query("SELECT cal_id FROM webcal_entry " . "WHERE cal_ext_for_id = {$id}");
if ($res) {
if ($row = dbi_fetch_row($res)) {
$ext_id = $row[0];
if (!dbi_query("UPDATE webcal_entry_user SET cal_status = 'A' " . "WHERE cal_login = '{$app_user}' AND cal_id = {$ext_id}")) {
$error = translate("Error approving event") . ": " . dbi_error();
}
}
dbi_free_result($res);
}
}
if ($ret == "list") {
do_redirect("list_unapproved.php");
示例11: lcs_import_data
//.........这里部分代码省略.........
$sql .= $names[$f] . ' = ?';
$sql_params[] = $values[$f];
}
$sql .= ' WHERE cal_id = ?';
$sql_params[] = $id;
} else {
$string_names = '';
$string_values = '';
for ($f = 0; $f < $namecnt; $f++) {
if ($f > 0) {
$string_names .= ', ';
$string_values .= ', ';
}
$string_names .= $names[$f];
$string_values .= '?';
$sql_params[] = $values[$f];
}
$sql = 'INSERT INTO webcal_entry ( ' . $string_names . ' ) VALUES ( ' . $string_values . ' )';
}
//do_debug ( date("H:i:s")." entry SQL> $sql" );
if (empty($error)) {
if (!dbi_execute($sql, $sql_params)) {
$error .= db_error();
// do_debug ( $error );
break;
} else {
if ($ImportType == 'RMTICS') {
$count_suc++;
}
}
}
// log add/update
if ($Entry['CalendarType'] == 'VTODO') {
activity_log($id, $login, $calUser, $updateMode ? LOG_UPDATE_T : LOG_CREATE_T, 'Import from ' . $ImportType);
} else {
activity_log($id, $login, $calUser, $updateMode ? LOG_UPDATE : LOG_CREATE, 'Import from ' . $ImportType);
}
// not in icalclient
if ($single_user == 'Y') {
$participants[0] = $single_user_login;
}
// Now add to webcal_import_data
if (!$updateMode) {
// only in icalclient
// add entry to webcal_import and webcal_import_data
$uid = generate_uid($id);
$uid = empty($Entry['UID']) ? $uid : $Entry['UID'];
if ($importId < 0) {
$importId = create_import_instance();
}
if ($ImportType == 'PALMDESKTOP') {
$sql = 'INSERT INTO webcal_import_data ( cal_import_id, cal_id,
cal_login, cal_import_type, cal_external_id )
VALUES ( ?, ?, ?, ?, ? )';
$sqlLog .= $sql . "<br />\n";
if (!dbi_execute($sql, array($importId, $id, $calUser, 'palm', $Entry['RecordID']))) {
$error = db_error();
break;
}
} else {
if ($ImportType == 'VCAL') {
$uid = empty($Entry['UID']) ? null : $Entry['UID'];
if (strlen($uid) > 200) {
$uid = null;
}
$sql = 'INSERT INTO webcal_import_data ( cal_import_id, cal_id,
示例12: get_pref_setting
$user_language = get_pref_setting($creator, 'LANGUAGE');
if ($send_user_mail == 'Y' && strlen($tempemail) && $SEND_EMAIL != 'N') {
reset_language(empty($user_language) || $user_language == 'none' ? $LANGUAGE : $user_language);
// translate ( 'Hello' )
$msg = str_replace('XXX', $tempfullname, translate('Hello, XXX.')) . "\n\n" . str_replace('XXX', $login_fullname, translate('XXX has approved an appointment and added comments.')) . "\n\n" . str_replace('XXX', $name, translate('Subject XXX')) . "\n" . str_replace('XXX', $description, translate('Description XXX')) . "\n" . str_replace('XXX', date_to_str($fmtdate), translate('Date XXX')) . ' ' . (empty($hour) && empty($minute) ? '' : str_replace('XXX', display_time('', 2, $eventstart, get_pref_setting($creator, 'TIME_FORMAT')), translate('Time XXX'))) . "\n";
if (!empty($SERVER_URL)) {
// DON'T change & to & here. email will handle it
$url = $SERVER_URL . 'view_entry.php?id=' . $id . '&em=1';
if ($htmlmail == 'Y') {
$url = activate_urls($url);
}
$msg .= "\n" . $url;
}
if (!empty($comments)) {
// translate ( 'Comments' )
$msg .= "\n\n" . str_replace('XXX', $comments, translate('Comments XXX'));
}
$from = strlen($login_email) ? $login_email : $EMAIL_FALLBACK_FROM;
// Send mail.
$mail->WC_Send($login_fullname, $tempemail, $tempfullname, $name, $msg, $htmlmail, $from);
activity_log($id, $login, $creator, LOG_NOTIFICATION, str_replace('XXX', $app_user, translate('Approved w/Comments by XXX.')));
}
}
// Return to login TIMEZONE.
set_env('TZ', $TIMEZONE);
if (empty($error) && empty($mailerError)) {
do_redirect(!empty($ret) && $ret == 'listall' ? 'list_unapproved.php' : (!empty($ret) && $ret == 'list' ? 'list_unapproved.php?' : 'view_entry.php?id=' . $id . '&') . 'user=' . $app_user);
exit;
}
// Process errors.
$mail->MailError($mailerError, $error);
示例13: processViewingBooking
function processViewingBooking($vars)
{
require_once ABSPATH . WPINC . '/registration.php';
$username = $vars['booked_by'];
$useremail = $username;
$address = $vars['address'];
$datetime = $vars['booking_datetime'];
$booked_by_name = $vars['booked_by_name'];
$booked_by_phone = $vars['booked_by_phone'];
$vars_string = implode($vars, "~~");
activity_log(array('type' => 'viewing', 'entry' => $vars_string));
if ($username && $address && $datetime) {
// create account if necessary
$user_id = username_exists($username);
if (!$user_id) {
if (!$booked_by_name) {
$booked_by_name = $username;
}
$random_password = wp_generate_password(12, false);
$user_id = wp_insert_user(array('user_login' => $username, 'user_pass' => $random_password, 'user_email' => $useremail, 'display_name' => $booked_by_name, 'role' => 'applicant'));
update_user_meta($user_id, 'phone', $booked_by_phone);
echo "New account created for " . $useremail . ", ID: " . $user_id;
wp_new_user_notification($user_id, $random_password);
} else {
echo "Account identified for " . $useremail . ", ID: " . $user_id;
}
// store event
$new_event = array();
$new_event['post_title'] = time();
$new_event['post_type'] = 'viewings';
$new_event['post_content'] = 'This is my new viewing.';
$new_event['post_status'] = 'publish';
$new_event['post_author'] = $user_id;
$event_id = wp_insert_post($new_event);
if ($event_id) {
update_post_meta($event_id, "address", $address);
update_post_meta($event_id, "datetime", $datetime);
}
} else {
$out = "please send booked_by, address and booking_datetime parameters. I found: ";
foreach ($vars as $key => $value) {
$out .= $key . ": " . $value . "; ";
}
echo $out;
}
}
示例14: fgets
$data .= fgets($fd, 4096);
}
}
fclose($fd);
$comment = getValue('description');
if (!dbi_execute('INSERT INTO webcal_blob ( cal_blob_id, cal_id,
cal_login, cal_name, cal_description, cal_size, cal_mime_type, cal_type,
cal_mod_date, cal_mod_time, cal_blob )
VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )', array($nextid, $id, $login, $filename, $description, $filesize, $mimetype, 'A', date('Ymd'), date('His'), NULL))) {
$error = db_error();
} else {
if (!dbi_update_blob('webcal_blob', 'cal_blob', "cal_blob_id = {$nextid}", $data)) {
$error = db_error();
} else {
// success! redirect to view event page
activity_log($id, $login, $login, LOG_ATTACHMENT, $filename);
do_redirect("view_entry.php?id={$id}");
}
}
} else {
die_miserable_death('Unsupported type');
// programmer error
}
}
if (!empty($error)) {
print_header();
echo print_error($error);
echo print_trailer();
exit;
}
}
示例15: logout
/**
* Logout
*/
function logout()
{
$this->data['title'] = "Logout";
// Log the logout!
$username = $this->ion_auth->user()->row()->username;
activity_log("User '{$username}' logged out", 'logout');
// log the user out
$logout = $this->ion_auth->logout();
// redirect them to the login page
$this->session->set_flashdata('message', $this->ion_auth->messages());
redirect('login', 'refresh');
$this->load->view($this->editor_layout, $data);
}