本文整理汇总了PHP中log__admin函数的典型用法代码示例。如果您正苦于以下问题:PHP log__admin函数的具体用法?PHP log__admin怎么用?PHP log__admin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log__admin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin__check_login
function admin__check_login($username, $password)
{
global $lang;
$pars = array(':adminname' => $username);
$query = "SELECT * FROM " . table('admin') . " \n WHERE adminname= :adminname";
$admin = orsee_query($query, $pars);
$continue = true;
$not_allowed = false;
$locked = false;
if ($continue) {
if (!isset($admin['admin_id'])) {
$continue = false;
log__admin('login_admin_wrong_username', 'used_username:' . $username);
//message('id');
}
}
if ($continue) {
$admin = admin__check_has_lockout($admin);
if ($admin['locked']) {
$continue = false;
log__admin('login_admin_locked_out', 'username:' . $username);
$locked = admin__track_unsuccessful_login($admin);
//message('locked');
}
}
if ($continue) {
$check_pw = crypt_verify($password, $admin['password_crypt']);
if (!$check_pw) {
$continue = false;
log__admin('login_admin_wrong_password', 'username:' . $username);
$locked = admin__track_unsuccessful_login($admin);
//message('wrong_pw');
}
}
if ($continue) {
$expadmindata = $admin;
// load admin rights
$expadmindata['rights'] = admin__load_admin_rights($expadmindata['admin_type']);
if (!$expadmindata['rights']['login'] || $expadmindata['disabled'] == 'y') {
$continue = false;
$not_allowed = true;
//message('not_allowed');
}
}
if ($continue) {
$_SESSION['expadmindata'] = $expadmindata;
$done = admin__track_successful_login($admin);
return true;
} else {
//if ($locked) message(lang('error_locked_out'));
if ($not_allowed) {
message(lang('error_not_allowed_to_login'));
}
return false;
}
}
示例2: message
if (isset($_REQUEST['edit']) && $_REQUEST['edit']) {
$continue = true;
if (!$_REQUEST['upload_name']) {
$continue = false;
message(lang('error_no_upload_file_name'));
}
if ($continue) {
$upload['session_id'] = $_REQUEST['session_id'];
$upload['upload_type'] = $_REQUEST['upload_type'];
$upload['upload_name'] = $_REQUEST['upload_name'];
$done = orsee_db_save_array($upload, "uploads", $upload['upload_id'], "upload_id");
if ($done) {
message(lang('changes_saved'));
$target = "file: " . $upload_id;
$target .= $experiment_id ? ", experiment:" . $experiment['experiment_name'] : ", general";
log__admin("file_upload", $target);
if ($experiment_id) {
redirect('admin/download_main.php?experiment_id=' . urlencode($experiment_id));
} else {
redirect('admin/download_main.php');
}
$proceed = false;
}
}
}
}
if ($proceed) {
//form for editing file
echo '<center>';
show_message();
echo ' <form method="post" action="download_edit.php">
示例3: time
$sitem['content_name'] = time();
}
if ($new_id == "content_shortcut") {
$sitem['content_name'] = trim($_REQUEST['content_shortcut']);
}
if ($new) {
$id = lang__insert_to_lang($sitem);
$done = true;
} else {
$done = orsee_db_save_array($sitem, "lang", $id, "lang_id");
}
if (!$new && $new_id == "time") {
$sitem['content_name'] = trim($_REQUEST['content_shortcut']);
}
if ($done) {
log__admin($item . "_edit", "lang_id:" . $sitem['content_type'] . ',' . $sitem['content_name']);
message(lang('changes_saved'));
if ($new) {
redirect('admin/lang_item_main.php?&item=' . $item);
} else {
redirect('admin/lang_item_edit.php?id=' . $id . '&item=' . $item);
}
} else {
message(lang('database_error'));
redirect('admin/lang_item_edit.php?id=' . $id . '&item=' . $item);
}
} else {
$titem = $_REQUEST;
if ($new_id == "content_shortcut") {
$titem['content_name'] = $_REQUEST['content_shortcut'];
}
示例4: lang
$deletion_message = lang('email_mailbox_deleted');
break;
}
echo '<center>';
if ($reallydelete) {
$pars = array(':id' => $id);
$query = "DELETE FROM " . table('lang') . "\n WHERE lang_id= :id";
$result = or_query($query, $pars);
// there should be a miore sophisticarted way of doing this
if ($reset_part_field) {
$pars = array(':content_name' => $titem['content_name']);
$query = "UPDATE " . table('participants') . "\n SET " . $reset_part_field . "='0'\n WHERE " . $reset_part_field . "= :content_name";
$result = or_query($query, $pars);
}
message($deletion_message);
log__admin($item . "_delete", "lang_id:" . $titem['content_type'] . ',' . $titem['content_name']);
redirect('admin/lang_item_main.php?item=' . $item);
}
}
if ($proceed) {
// form
echo ' <CENTER>
<TABLE class="or_formtable">
<TR><TD colspan=2>
<TABLE width="100%" border=0 class="or_panel_title"><TR>
<TD style="background: ' . $color['panel_title_background'] . '; color: ' . $color['panel_title_textcolor'] . '" align="center">
' . $header . ' - ' . $titem[$headervar] . '
</TD>
</TR></TABLE>
</TD></TR>
<TR>
示例5: array
$pars = array();
foreach ($_REQUEST['experimenter_list'] as $a => $d) {
$pars[] = array(':a' => $a, ':d' => $d);
}
$query = "UPDATE " . table("admin") . "\n SET experimenter_list= :d\n WHERE admin_id= :a";
$done = or_query($query, $pars);
}
if (isset($_REQUEST['admin_type']) && is_array($_REQUEST['admin_type'])) {
$pars = array();
foreach ($_REQUEST['admin_type'] as $a => $d) {
$pars[] = array(':a' => $a, ':d' => $d);
}
$query = "UPDATE " . table("admin") . "\n SET admin_type= :d\n WHERE admin_id= :a";
$done = or_query($query, $pars);
}
log__admin("admin_show_edit");
message(lang('changes_saved'));
redirect("admin/admin_show.php");
$proceed = false;
}
}
}
if ($proceed) {
echo '<center><br>
' . button_link('admin_edit.php?new=true', lang('create_new'), 'plus-circle');
echo '<br>
<FORM action="' . thisdoc() . '" method="POST">';
echo '<table class="or_listtable"><thead>';
if (check_allow('admin_edit')) {
echo '<tr style="background: ' . $color['list_header_background'] . '; color: ' . $color['list_header_textcolor'] . ';">
示例6: get_languages
// load languages
$languages = get_languages();
if ($job_name) {
$job = orsee_db_load_array("cron_jobs", $job_name, "job_name");
} else {
$job = array('job_name' => '', 'enabled' => 'n', 'job_last_exec' => 0, 'job_time' => '');
}
$continue = true;
if (isset($_REQUEST['edit']) && $_REQUEST['edit']) {
if (!$_REQUEST['job_name']) {
message(lang('name_for_cronjob_required'));
$continue = false;
}
if ($continue) {
$done = orsee_db_save_array($_REQUEST, "cron_jobs", $job_name, "job_name");
log__admin("cronjob_edit", $_REQUEST['job_name']);
message(lang('changes_saved'));
redirect("admin/cronjob_edit.php?job_name=" . $job_name);
$proceed = false;
} else {
$job = $_REQUEST;
}
}
}
if ($proceed) {
// form
echo '<CENTER>';
show_message();
echo '
<FORM action="cronjob_edit.php">
示例7: message
if (!$bulk[$inv_lang . '_body']) {
message(lang('body_of_message') . ': ' . lang('missing_language') . ": " . $inv_lang);
$continue = false;
}
}
if ($continue) {
$bulk_id = time();
$pars = array();
foreach ($inv_langs as $inv_lang) {
$pars[] = array(':bulk_id' => $bulk_id, ':inv_lang' => $inv_lang, ':subject' => $bulk[$inv_lang . '_subject'], ':body' => $bulk[$inv_lang . '_body']);
}
$query = "INSERT INTO " . table('bulk_mail_texts') . " \n\t\t\t\t\tSET bulk_id= :bulk_id,\n\t\t\t\t\tlang= :inv_lang,\n\t\t\t\t\tbulk_subject= :subject,\n\t\t\t\t\tbulk_text= :body";
$done = or_query($query, $pars);
$done = experimentmail__send_bulk_mail_to_queue($bulk_id, $plist_ids);
message($number . ' ' . lang('xxx_bulk_mails_sent_to_mail_queue'));
log__admin("bulk_mail", "recipients:" . $number);
redirect('admin/');
}
}
}
if ($proceed) {
echo '<center>
<TABLE class="or_page_subtitle" style="background: ' . $color['page_subtitle_background'] . '; color: ' . $color['page_subtitle_textcolor'] . '; width: 80%">
<TR><TD align="center">' . $number . ' ' . lang('recipients') . '</TD></TR></TABLE>
';
show_message();
// form
echo '<FORM action="' . thisdoc() . '" method="post">
<TABLE class="or_formtable" style="width: 80%">';
foreach ($inv_langs as $inv_lang) {
if (count($inv_langs) > 1) {
示例8: message
message(lang('error_new_password_must_be_different_from_old_password'));
$continue = false;
}
}
if (!preg_match('/' . $settings['admin_password_regexp'] . '/', $password)) {
message(lang('error_password_does_not_meet_requirements'));
$continue = false;
}
if ($continue == false) {
message(lang('error_password_not_changed'));
redirect("admin/admin_pw.php");
} else {
admin__set_password($password, $expadmindata['admin_id']);
message(lang('password_changed_log_in_again'));
log__admin("admin_password_change", $expadmindata['adminname']);
log__admin("logout");
admin__logout();
redirect("admin/admin_login.php?pw=true");
}
$proceed = false;
}
}
if ($proceed) {
echo '<center><BR>';
show_message();
echo '
<form action="admin_pw.php" method="POST">
<table class="or_formtable" style="max-width: 50%">
<tr>
<td>
' . lang('old_password') . ':
示例9: lang__insert_to_lang
if (!in_array($inst_lang, $inv_langs)) {
$sitem[$inst_lang] = $sitem[$settings['public_standard_language']];
}
}
// is unknown or known?
if (!$id) {
$done = lang__insert_to_lang($sitem);
} else {
$done = orsee_db_save_array($sitem, "lang", $id, "lang_id");
}
if ($done) {
message(lang('mail_text_saved'));
} else {
message(lang('database_error'));
}
log__admin("experiment_customize_session_reminder", "experiment:" . $experiment['experiment_name']);
if ($save_preview) {
redirect('admin/experiment_customize_reminder.php?experiment_id=' . $experiment_id . '&show_preview=true');
} else {
redirect('admin/experiment_customize_reminder.php?experiment_id=' . $experiment_id);
}
}
}
if ($proceed) {
$pars = array(':experiment_id' => $experiment_id);
$query = "SELECT * from " . table('lang') . "\n WHERE content_type='experiment_session_reminder_mail'\n AND content_name= :experiment_id";
$experiment_mail = orsee_query($query, $pars);
$session = experimentmail__preview_fake_session_details($experiment_id);
if ($show_preview) {
echo '<TABLE class="or_formtable" style="width: 80%;">';
echo '<TR><TD colspan=2>
示例10: array
$pars_update[] = array(':value' => $ovalue, ':name' => $oname, ':style' => $style);
} else {
$pars_new[] = array(':value' => $ovalue, ':name' => $oname, ':style' => $style, ':now' => $now);
$now++;
}
}
if (count($pars_update) > 0) {
$query = "UPDATE " . table('options') . "\n SET option_value= :value\n WHERE option_name= :name\n AND option_style= :style\n AND option_type= 'color'";
$done = or_query($query, $pars_update);
}
if (count($pars_new) > 0) {
$query = "INSERT INTO " . table('options') . " SET\n option_id= :now,\n option_name= :name,\n option_value= :value,\n option_style= :style,\n option_type= 'color'";
$done = or_query($query, $pars_new);
}
message(lang('changes_saved'));
log__admin("options_colors_edit", "style:" . $style);
redirect('admin/options_colors.php?style=' . $style);
}
}
if ($proceed) {
if (check_allow('settings_edit_colors')) {
echo '
<FORM action="options_colors.php" method=post>
<INPUT type=hidden name="style" value="' . $style . '">';
}
echo '<TABLE class="or_formtable" style="width: 80%;">';
if (check_allow('settings_edit_colors')) {
echo '
<TR>
<TD colspan=2 align=center>
<INPUT class="button" type=submit name="change" value="' . lang('change') . '">
示例11: faq__load_question
}
if ($proceed) {
$question = faq__load_question($faq_id);
$answer = faq__load_answer($faq_id);
// load languages
$languages = get_languages();
if ($reallydelete) {
$pars = array(':faq_id' => $faq_id);
$query = "DELETE FROM " . table('lang') . "\n WHERE content_type='faq_question'\n AND content_name= :faq_id";
$result = or_query($query, $pars);
$query = "DELETE FROM " . table('lang') . "\n WHERE content_type='faq_answer'\n AND content_name= :faq_id";
$result = or_query($query, $pars);
$query = "DELETE FROM " . table('faqs') . "\n WHERE faq_id= :faq_id";
$result = or_query($query, $pars);
message(lang('faq_deleted'));
log__admin("faq_delete", "faq_id:" . $faq_id);
redirect('admin/faq_main.php');
}
}
if ($proceed) {
// form
echo ' <center>
<FORM action="faq_delete.php">
<INPUT type=hidden name="faq_id" value="' . $faq_id . '">
<TABLE class="or_formtable">
<TR><TD colspan="2">
<TABLE width="100%" border=0 class="or_panel_title"><TR>
<TD style="background: ' . $color['panel_title_background'] . '; color: ' . $color['panel_title_textcolor'] . '" align="center">
"' . $question[lang('lang')] . '"
</TD>
示例12: elseif
} elseif ($send || $sendall) {
// send mails!
$allow = check_allow('experiment_invite_participants', 'experiment_mail_participants.php?experiment_id=' . $experiment_id);
if ($allow) {
$whom = $sendall ? "all" : "not-invited";
$measure_start = getmicrotime();
$sent = experimentmail__send_invitations_to_queue($experiment_id, $whom);
message($sent . ' ' . lang('xxx_inv_mails_added_to_mail_queue'));
$measure_end = getmicrotime();
message(lang('time_needed_in_seconds') . ': ' . round($measure_end - $measure_start, 5));
log__admin("experiment_send_invitations", "experiment:" . $experiment['experiment_name']);
redirect("admin/experiment_mail_participants.php?experiment_id=" . $experiment_id);
}
} else {
message(lang('mail_text_saved'));
log__admin("experiment_edit_invitation_mail", "experiment:" . $experiment['experiment_name']);
redirect('admin/' . thisdoc() . '?experiment_id=' . $experiment_id);
}
}
}
if ($proceed) {
$pars = array(':experiment_id' => $experiment_id);
$query = "SELECT * from " . table('lang') . " \n\t\t\tWHERE content_type='experiment_invitation_mail' \n\t\t\tAND content_name= :experiment_id";
$experiment_mail = orsee_query($query, $pars);
if (!isset($experiment_mail['lang_id'])) {
$experiment_mail = array('lang_id' => '');
foreach ($inv_langs as $inv_lang) {
$experiment_mail[$inv_lang] = '';
}
}
// form
示例13: array
$ok = true;
$pars = array();
$in_clause = "";
}
if ($ok) {
$query = "SELECT participant_id, email\n FROM " . table('participants') . "\n WHERE status_id='0' " . $in_clause;
$result = or_query($query, $pars);
while ($line = pdo_fetch_assoc($result)) {
$del_emails[$line['participant_id']] = $line['email'];
}
$query = "DELETE FROM " . table('participants') . "\n WHERE status_id='0' " . $in_clause;
$done = or_query($query, $pars);
$number = pdo_num_rows($done);
message($number . ' ' . lang('xxx_temp_participants_deleted'));
foreach ($del_emails as $participant_id => $email) {
log__admin("participant_unconfirmed_delete", "participant_id: " . $participant_id . ', email: ' . $email);
}
redirect("admin/participants_unconfirmed.php");
}
}
}
if ($proceed) {
echo '<center>';
echo '<FORM action="participants_unconfirmed.php" method="POST">';
$posted_query = array('query' => array(0 => array("statusids_multiselect" => array("not" => "", "ms_status" => "0"))));
$query_array = query__get_query_array($posted_query['query']);
$query = query__get_query($query_array, 0, array(), 'creation_time DESC', false);
echo '<BR>
<TABLE width="80%" border="0">
<TR><TD>
<TABLE width="100%" border="0">
示例14: check_allow
if ($proceed) {
if (isset($_REQUEST['reallydelete']) && $_REQUEST['reallydelete']) {
$reallydelete = true;
} else {
$reallydelete = false;
}
$allow = check_allow('admin_delete', 'admin_edit.php?admin_id=' . $admin_id);
}
if ($proceed) {
$admin = orsee_db_load_array("admin", $admin_id, "admin_id");
echo '<center>';
if ($reallydelete) {
$pars = array(':admin_id' => $admin_id);
$query = "DELETE FROM " . table('admin') . "\n WHERE admin_id= :admin_id";
$result = or_query($query, $pars);
log__admin("admin_delete", $admin['adminname']);
message(lang('admin_deleted') . ': ' . $admin['adminname']);
redirect('admin/admin_show.php');
$proceed = false;
}
}
if ($proceed) {
// form
$num_experiments = experiment__count_experiments("experimenter LIKE :adminname", array(':adminname' => '%|' . $admin['adminname'] . '|%'));
if ($num_experiments > 0) {
echo lang('admin_delete_warning');
}
echo '
<TABLE class="or_formtable">
<TR><TD colspan="2">
<TABLE width="100%" border=0 class="or_panel_title"><TR>
示例15: orsee_db_save_array
if (isset($line['new_budget_id'])) {
$budget_id = $line['new_budget_id'];
} else {
$budget_id = 1;
}
} else {
$new = false;
}
$budget = $_REQUEST;
$budget['budget_id'] = $budget_id;
if (!$budget['budget_limit']) {
$budget['budget_limit'] = NULL;
}
$done = orsee_db_save_array($budget, "budgets", $budget_id, "budget_id");
message(lang('changes_saved'));
log__admin("payments_budget_edit", "budget_id:" . $budget['budget_id']);
//redirect ("admin/payments_budget_edit.php?budget_id=".$budget_id);
} else {
$budget = $_REQUEST;
}
}
}
if ($proceed) {
// form
echo '<CENTER>';
show_message();
echo '
<FORM action="payments_budget_edit.php">';
if (isset($budget_id)) {
echo '<INPUT type=hidden name="budget_id" value="' . $budget_id . '">';
}