本文整理汇总了PHP中get_post_var函数的典型用法代码示例。如果您正苦于以下问题:PHP get_post_var函数的具体用法?PHP get_post_var怎么用?PHP get_post_var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_post_var函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: edit_pic_views_after_edit_file
function edit_pic_views_after_edit_file($pid)
{
global $CONFIG;
$hits = get_post_var('hits', $pid);
if (is_numeric($hits) && $hits >= 0) {
cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET hits = '{$hits}' WHERE pid = {$pid} LIMIT 1");
}
}
开发者ID:phill104,项目名称:branches,代码行数:8,代码来源:codebase.php
示例2: load_shared_user_schedules
function load_shared_user_schedules()
{
global $global_user;
global $maindb;
// get some values
$s_year = get_post_var("year");
$s_semester = get_post_var("semester");
// get the set of usernames and ids
$a_queryvars = array("database" => $maindb, "table" => "students", "disabled" => "0");
$s_querystring = "SELECT `username`,`id` FROM `[database]`.`[table]` WHERE `disabled`='[disabled]'";
$user_data = db_query($s_querystring, $a_queryvars);
// get the users that shared their schedules with this user
$a_queryvars = array("database" => $maindb, "table" => "user_settings", "id" => $global_user->get_id());
$s_querystring = "SELECT GROUP_CONCAT(`user_id`,',') AS `ids` FROM `[database]`.`[table]` WHERE `share_schedule_with` LIKE '%|[id]|%'";
$can_view_db = db_query($s_querystring, $a_queryvars);
$can_view_db = explode(",", $can_view_db[0]["ids"]);
$can_view = array();
for ($i = 0; $i < count($can_view_db); $i++) {
$can_view_db[$i] = intval($can_view_db[$i]);
}
// get the users that can view this user's schedule
$shared_with_db = $global_user->get_schedule_shared_users();
$shared_with = array();
// translate user ids to usernames
for ($i = 0; $i < count($user_data); $i++) {
$id = intval($user_data[$i]["id"]);
$username = $user_data[$i]["username"];
if (in_array($id, $can_view_db)) {
$user = user::load_user_by_id($id, FALSE);
if ($user !== null) {
$can_view[] = $user;
}
}
if (in_array($id, $shared_with_db)) {
$shared_with[] = $username;
}
}
// build the return value
$retval = new stdClass();
$retval->sharedUsers = new stdClass();
$retval->otherUserSchedules = array();
for ($i = 0; $i < count($shared_with); $i++) {
$retval->sharedUsers->{$shared_with}[$i] = TRUE;
}
for ($i = 0; $i < count($can_view); $i++) {
$retval->otherUserSchedules[$i] = new stdClass();
$retval->otherUserSchedules[$i]->username = $can_view[$i]->get_name();
$a_classes = $can_view[$i]->get_user_classes($s_year, $s_semester);
$a_crns = array();
for ($j = 0; $j < count($a_classes); $j++) {
$a_crns[] = $a_classes[$j]->crn;
}
$retval->otherUserSchedules[$i]->schedule = $a_crns;
}
// return the return value
return json_encode(array(new command("success", $retval)));
}
开发者ID:op-erator,项目名称:banwebplus,代码行数:57,代码来源:sharing.php
示例3: enable_account
function enable_account()
{
global $maindb;
global $mysqli;
$username = get_post_var("username");
$query = db_query("UPDATE `{$maindb}`.`students` SET `disabled`='0' WHERE `username`='[username]'", array("username" => $username));
if ($query !== FALSE && $mysqli->affected_rows > 0) {
return json_encode(array(new command("print success", "The account has been enabled. Reload the page to see the affects of the changes.")));
}
return json_encode(array(new command("print failure", "Failed to enable account \"{$username}\".")));
}
开发者ID:op-erator,项目名称:banwebplus,代码行数:11,代码来源:ajax_calls_super.php
示例4: gu_sender_test
function gu_sender_test()
{
// Get current settings, which may not have been saved
$use_smtp = is_post_var('use_smtp');
$smtp_server = get_post_var('smtp_server');
$smtp_port = (int) get_post_var('smtp_port');
$smtp_encryption = get_post_var('smtp_encryption');
$smtp_username = get_post_var('smtp_username');
$smtp_password = get_post_var('smtp_password');
$use_sendmail = is_post_var('use_sendmail');
$use_phpmail = is_post_var('use_phpmail');
if (!($use_smtp || $use_sendmail || $use_phpmail)) {
return gu_error(t('No method of mail transportation has been configured'));
}
$test_msg = t('If you have received this email then your settings clearly work!');
// Test SMTP settings first
if ($use_smtp) {
$mailer = new gu_mailer();
if ($mailer->init(TRUE, $smtp_server, $smtp_port, $smtp_encryption, $smtp_username, $smtp_password, FALSE, FALSE)) {
if (!$mailer->send_admin_mail('[' . gu_config::get('collective_name') . '] Testing SMTP', $test_msg)) {
return gu_error(t('Unable to send test message using SMTP'));
}
} else {
return gu_error(t('Unable to initialize mailer with the SMTP settings'));
}
$mailer->disconnect();
}
// Test Sendmail next
if ($use_sendmail) {
$mailer = new gu_mailer();
if ($mailer->init(FALSE, '', '', '', '', '', FALSE, FALSE)) {
if (!$mailer->send_admin_mail('[' . gu_config::get('collective_name') . '] Testing Sendmail', $test_msg)) {
return gu_error(t('Unable to send test message using Sendmail'));
}
} else {
return gu_error(t('Unable to initialize mailer with Sendmail'));
}
$mailer->disconnect();
}
// Test PHP mail next
if ($use_phpmail) {
$mailer = new gu_mailer();
if ($mailer->init(FALSE, '', '', '', '', '', FALSE, TRUE)) {
if (!$mailer->send_admin_mail('[' . gu_config::get('collective_name') . '] Testing PHP mail', $test_msg)) {
return gu_error(t('Unable to send test message using PHP mail'));
}
} else {
return gu_error(t('Unable to initialize mailer with PHP mail'));
}
$mailer->disconnect();
}
gu_success(t('Test messages sent to <br><i>%</i></b>', array(gu_config::get('admin_email'))));
}
开发者ID:inscriptionweb,项目名称:gutuma,代码行数:53,代码来源:settings.php
示例5: check_user_info
function check_user_info(&$error)
{
global $CONFIG;
global $lang_register_php, $lang_common, $lang_register_approve_email;
global $lang_register_user_login, $lang_errors;
$superCage = Inspekt::makeSuperCage();
$user_name = trim(get_post_var('username'));
$password = trim(get_post_var('password'));
$password_again = trim(get_post_var('password_verification'));
$email = trim(get_post_var('email'));
$profile1 = $superCage->post->getEscaped('user_profile1');
$profile2 = $superCage->post->getEscaped('user_profile2');
$profile3 = $superCage->post->getEscaped('user_profile3');
$profile4 = $superCage->post->getEscaped('user_profile4');
$profile5 = $superCage->post->getEscaped('user_profile5');
$profile6 = $superCage->post->getEscaped('user_profile6');
$agree_disclaimer = $superCage->post->getEscaped('agree');
$captcha_confirmation = $superCage->post->getEscaped('confirmCode');
$sql = "SELECT null FROM {$CONFIG['TABLE_USERS']} WHERE user_name = '{$user_name}'";
$result = cpg_db_query($sql);
if (mysql_num_rows($result)) {
$error = '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['err_user_exists'] . '</li>';
return false;
}
mysql_free_result($result);
if (utf_strlen($user_name) < 2) {
$error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['username_warning2'] . '</li>';
}
if (!empty($CONFIG['global_registration_pw'])) {
$global_registration_pw = get_post_var('global_registration_pw');
if ($global_registration_pw != $CONFIG['global_registration_pw']) {
$error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['err_global_pw'] . '</li>';
} elseif ($password == $CONFIG['global_registration_pw']) {
$error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['err_global_pass_same'] . '</li>';
}
}
if (utf_strlen($password) < 2) {
$error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['password_warning1'] . '</li>';
}
if ($password == $user_name) {
$error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['password_warning2'] . '</li>';
}
if ($password != $password_again) {
$error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['password_verification_warning1'] . '</li>';
}
if (!Inspekt::isEmail($email)) {
$error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['email_warning2'] . '</li>';
}
if ($CONFIG['user_registration_disclaimer'] == 2 && $agree_disclaimer != 1) {
$error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['err_disclaimer'] . '</li>';
}
// Perform the ban check against email address and username
$result = cpg_db_query("SELECT null FROM {$CONFIG['TABLE_BANNED']} WHERE user_name = '{$user_name}' AND brute_force = 0 LIMIT 1");
if (mysql_num_rows($result)) {
$error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['user_name_banned'] . '</li>';
}
mysql_free_result($result);
$result = cpg_db_query("SELECT null FROM {$CONFIG['TABLE_BANNED']} WHERE email = '{$email}' AND brute_force = 0 LIMIT 1");
if (mysql_num_rows($result)) {
$error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['email_address_banned'] . '</li>';
}
mysql_free_result($result);
// check captcha
if ($CONFIG['registration_captcha'] != 0) {
if (!captcha_plugin_enabled('register')) {
require "include/captcha.inc.php";
if (!PhpCaptcha::Validate($captcha_confirmation)) {
$error .= '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_errors['captcha_error'] . '</li>';
}
} else {
$error = CPGPluginAPI::filter('captcha_register_validate', $error);
}
}
if (!$CONFIG['allow_duplicate_emails_addr']) {
$sql = "SELECT null FROM {$CONFIG['TABLE_USERS']} WHERE user_email = '{$email}'";
$result = cpg_db_query($sql);
if (mysql_num_rows($result)) {
$error = '<li style="list-style-image:url(images/icons/stop.png)">' . $lang_register_php['err_duplicate_email'] . '</li>';
}
mysql_free_result($result);
}
$error = CPGPluginAPI::filter('register_form_validate', $error);
if ($error != '') {
return false;
}
if ($CONFIG['reg_requires_valid_email'] || $CONFIG['admin_activation']) {
$active = 'NO';
list($usec, $sec) = explode(' ', microtime());
$seed = (double) $sec + (double) $usec * 100000;
srand($seed);
$act_key = md5(uniqid(rand(), 1));
} else {
$active = 'YES';
$act_key = '';
}
$encpassword = md5($password);
$user_language = $CONFIG['lang'];
$sql = "INSERT INTO {$CONFIG['TABLE_USERS']} (user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_profile1, user_profile2, user_profile3, user_profile4, user_profile5, user_profile6, user_language) VALUES (NOW(), '{$active}', '{$act_key}', '{$user_name}', '{$encpassword}', '{$email}', '{$profile1}', '{$profile2}', '{$profile3}', '{$profile4}', '{$profile5}', '{$profile6}', '{$user_language}')";
$result = cpg_db_query($sql);
$user_array = array();
//.........这里部分代码省略.........
开发者ID:stephenjschaefer,项目名称:APlusPhotography,代码行数:101,代码来源:register.php
示例6: fail
fail('MySQL fetch', $db->error);
}
// Mitigate timing attacks (probing for valid usernames)
if (isset($dummy_salt) && strlen($hash) < 20) {
$hash = $dummy_salt;
}
if ($hasher->CheckPassword($pass, $hash)) {
$what = 'Authentication succeeded';
} else {
$what = 'Authentication failed';
$op = 'fail';
// Definitely not 'change'
}
if ($op === 'change') {
$stmt->close();
$newpass = get_post_var('newpass');
if (strlen($newpass) > 72) {
fail('The new password is too long');
}
if (($check = my_pwqcheck($newpass, $pass, $user)) !== 'OK') {
fail($check);
}
$hash = $hasher->HashPassword($newpass);
if (strlen($hash) < 20) {
fail('Failed to hash new password');
}
unset($hasher);
($stmt = $db->prepare('update users set user_password=? where user_name=?')) || fail('MySQL prepare', $db->error);
$stmt->bind_param('ss', $hash, $user) || fail('MySQL bind_param', $db->error);
$stmt->execute() || fail('MySQL execute', $db->error);
$what = 'Password changed';
开发者ID:skulkarni8,项目名称:wwo,代码行数:31,代码来源:user-man.php
示例7: define
<?php
define('puush', '');
require_once 'config.php';
require_once 'func.php';
// ?
$k = get_post_var('k');
// ?
$c = get_post_var('c');
// Check for the file
if (!isset($_FILES['f'])) {
exit('ERR No file provided.');
}
// The file they are uploading
$file = $_FILES['f'];
// Check the size, max 250 MB
if ($file['size'] > MAX_FILE_SIZE) {
exit('ERR File is too big.');
}
// Ensure the image is actually a file and not a friendly virus
if (validate_image($file) === FALSE) {
exit('ERR Invalid image.');
}
// Generate a new file name
$ext = get_ext($file['name']);
$generated_name = generate_upload_name($ext);
// Move the file
move_uploaded_file($file['tmp_name'], UPLOAD_DIR . $generated_name . '.' . $ext);
// ahem
echo '0,' . sprintf(FORMATTED_URL, $generated_name) . ',-1,-1';
开发者ID:KiwiNetwork,项目名称:puush-api,代码行数:30,代码来源:upload.php
示例8: check_user_info
function check_user_info(&$error)
{
global $CONFIG;
//, $PHP_SELF;
global $lang_register_php, $lang_register_confirm_email, $lang_continue, $lang_register_approve_email, $lang_register_activated_email, $lang_register_user_login;
//$CONFIG['admin_activation'] = FALSE;
//$CONFIG['admin_activation'] = TRUE;
$user_name = trim(get_post_var('username'));
$password = trim(get_post_var('password'));
$password_again = trim(get_post_var('password_verification'));
$email = trim(get_post_var('email'));
$profile1 = addslashes($_POST['user_profile1']);
$profile2 = addslashes($_POST['user_profile2']);
$profile3 = addslashes($_POST['user_profile3']);
$profile4 = addslashes($_POST['user_profile4']);
$profile5 = addslashes($_POST['user_profile5']);
$profile6 = addslashes($_POST['user_profile6']);
$sql = "SELECT user_id " . "FROM {$CONFIG['TABLE_USERS']} " . "WHERE user_name = '" . addslashes($user_name) . "'";
$result = cpg_db_query($sql);
if (mysql_num_rows($result)) {
$error = '<li>' . $lang_register_php['err_user_exists'];
return false;
}
mysql_free_result($result);
if (utf_strlen($user_name) < 2) {
$error .= '<li>' . $lang_register_php['err_uname_short'];
}
if (utf_strlen($password) < 2) {
$error .= '<li>' . $lang_register_php['err_password_short'];
}
if ($password == $user_name) {
$error .= '<li>' . $lang_register_php['err_uname_pass_diff'];
}
if ($password != $password_again) {
$error .= '<li>' . $lang_register_php['err_password_mismatch'];
}
if (!eregi("^[_\\.0-9a-z\\-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,6}\$", $email)) {
$error .= '<li>' . $lang_register_php['err_invalid_email'];
}
if ($error != '') {
return false;
}
if (!$CONFIG['allow_duplicate_emails_addr']) {
$sql = "SELECT user_id " . "FROM {$CONFIG['TABLE_USERS']} " . "WHERE user_email = '" . addslashes($email) . "'";
$result = cpg_db_query($sql);
if (mysql_num_rows($result)) {
$error = '<li>' . $lang_register_php['err_duplicate_email'];
return false;
}
mysql_free_result($result);
}
if ($CONFIG['reg_requires_valid_email'] || $CONFIG['admin_activation']) {
$active = 'NO';
list($usec, $sec) = explode(' ', microtime());
$seed = (double) $sec + (double) $usec * 100000;
srand($seed);
$act_key = md5(uniqid(rand(), 1));
} else {
$active = 'YES';
$act_key = '';
}
if ($CONFIG['enable_encrypted_passwords']) {
$encpassword = md5($password);
} else {
$encpassword = $password;
}
$sql = "INSERT INTO {$CONFIG['TABLE_USERS']} " . "(user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_profile1, user_profile2, user_profile3, user_profile4, user_profile5, user_profile6) " . "VALUES (NOW(), '{$active}', '{$act_key}', '" . addslashes($user_name) . "', '" . addslashes($encpassword) . "', '" . addslashes($email) . "', '{$profile1}', '{$profile2}', '{$profile3}', '{$profile4}', '{$profile5}', '{$profile6}')";
if ($CONFIG['log_mode']) {
log_write('New user "' . addslashes($user_name) . '" created on ' . date("F j, Y, g:i a"), CPG_ACCESS_LOG);
}
$result = cpg_db_query($sql);
if ($CONFIG['reg_requires_valid_email']) {
if (!$CONFIG['admin_activation'] == 1) {
//user gets activation email
$act_link = rtrim($CONFIG['site_url'], '/') . '/register.php?activate=' . $act_key;
$template_vars = array('{SITE_NAME}' => $CONFIG['gallery_name'], '{USER_NAME}' => $user_name, '{ACT_LINK}' => $act_link);
if (!cpg_mail($email, sprintf($lang_register_php['confirm_email_subject'], $CONFIG['gallery_name']), nl2br(strtr($lang_register_confirm_email, $template_vars)))) {
cpg_die(CRITICAL_ERROR, $lang_register_php['failed_sending_email'], __FILE__, __LINE__);
}
}
if ($CONFIG['admin_activation'] == 1) {
msg_box($lang_register_php['information'], $lang_register_php['thank_you_admin_activation'], $lang_continue, 'index.php');
} else {
msg_box($lang_register_php['information'], $lang_register_php['thank_you'], $lang_continue, 'index.php');
}
} else {
msg_box($lang_register_php['information'], $lang_register_php['acct_active'], $lang_continue, 'index.php');
}
// email notification to admin
if ($CONFIG['reg_notify_admin_email']) {
// get default language in which to inform the admin
$lang_register_php_def = cpg_get_default_lang_var('lang_register_php');
$lang_register_approve_email_def = cpg_get_default_lang_var('lang_register_approve_email');
if ($CONFIG['admin_activation'] == 1) {
$act_link = rtrim($CONFIG['site_url'], '/') . '/register.php?activate=' . $act_key;
$template_vars = array('{SITE_NAME}' => $CONFIG['gallery_name'], '{USER_NAME}' => $user_name, '{ACT_LINK}' => $act_link);
cpg_mail('admin', sprintf($lang_register_php_def['notify_admin_request_email_subject'], $CONFIG['gallery_name']), nl2br(strtr($lang_register_approve_email_def, $template_vars)));
} else {
cpg_mail('admin', sprintf($lang_register_php_def['notify_admin_email_subject'], $CONFIG['gallery_name']), sprintf($lang_register_php_def['notify_admin_email_body'], $user_name));
}
//.........这里部分代码省略.........
开发者ID:alencarmo,项目名称:OCF,代码行数:101,代码来源:register.php
示例9: process_post_data
function process_post_data()
{
global $CONFIG, $lang_errors;
$superCage = Inspekt::makeSuperCage();
//Check if the form token is valid
if (!checkFormToken()) {
cpg_die(ERROR, $lang_errors['invalid_form_token'], __FILE__, __LINE__);
}
$field_list = array('group_name', 'group_quota', 'can_rate_pictures', 'can_send_ecards', 'can_post_comments', 'can_upload_pictures', 'pub_upl_need_approval', 'can_create_albums', 'priv_upl_need_approval', 'access_level');
$group_id_array = get_post_var('group_id');
$guests_disabled = $CONFIG['allow_unlogged_access'] == 0;
foreach ($group_id_array as $key => $group_id) {
// For guest/anonymous group, update the configuration setting 'allow_unlogged_access'
if ($group_id == 3) {
cpg_config_set('allow_unlogged_access', $superCage->post->getInt('access_level_' . $group_id));
}
// For the guest/anonymous group, don't update the database if the settings were disabled
if ($group_id == 3 && $guests_disabled) {
continue;
}
$set_statement = '';
foreach ($field_list as $field) {
if ($field == 'group_name') {
$set_statement .= $field . "='" . $superCage->post->getEscaped($field . '_' . $group_id) . "',";
} else {
$set_statement .= $field . "='" . $superCage->post->getInt($field . '_' . $group_id) . "',";
}
}
$set_statement = substr($set_statement, 0, -1);
cpg_db_query("UPDATE {$CONFIG['TABLE_USERGROUPS']} SET {$set_statement} WHERE group_id = '{$group_id}' LIMIT 1");
}
}
开发者ID:JoseCOCA,项目名称:baudprint,代码行数:32,代码来源:groupmgr.php
示例10: get_pic_url
}
// Create and send the e-card
if ($superCage->post->keyExists('subject') && $valid_sender_email) {
$gallery_url_prefix = $CONFIG['ecards_more_pic_target'] . (substr($CONFIG['ecards_more_pic_target'], -1) == '/' ? '' : '/');
if ($CONFIG['make_intermediate'] && max($row['pwidth'], $row['pheight']) > $CONFIG['picture_width']) {
$n_picname = get_pic_url($row, 'normal');
} else {
$n_picname = get_pic_url($row, 'fullsize');
}
if (!stristr($n_picname, 'http:')) {
$n_picname = $gallery_url_prefix . $n_picname;
}
//output list of reasons checkmarked
$reasons = $lang_report_php['reasons_list_heading'] . $LINEBREAK;
if ($superCage->post->keyExists('reason')) {
foreach (get_post_var('reason') as $value) {
$value = $lang_report_php["{$value}"];
$reason_list .= "{$value}, ";
}
} else {
$reasons .= "{$lang_report_php['no_reason_given']}";
}
$reason_list = substr($reason_list, 0, -2);
//remove trailing comma and space
$reasons .= $reason_list;
$msg_content = nl2br(strip_tags($message));
$data = array('sn' => $sender_name, 'se' => $sender_email, 'p' => $n_picname, 'su' => $subject, 'm' => $message, 'r' => $reasons, 'c' => $comment, 'cid' => $cid, 'pid' => $pid, 't' => $what);
$encoded_data = urlencode(base64_encode(serialize($data)));
$params = array('{LANG_DIR}' => $lang_text_dir, '{TITLE}' => sprintf($lang_report_php['report_subject'], $sender_name, $type), '{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'], '{VIEW_REPORT_TGT}' => "{$gallery_url_prefix}displayreport.php?data={$encoded_data}", '{VIEW_REPORT_LNK}' => $lang_report_php['view_report'], '{VIEW_REPORT_LNK_PLAINTEXT}' => $lang_report_php['view_report_plaintext'], '{PIC_URL}' => $n_picname, '{URL_PREFIX}' => $gallery_url_prefix, '{PIC_TGT}' => "{$CONFIG['ecards_more_pic_target']}displayimage.php?pid=" . $pid, '{SUBJECT}' => $subject, '{MESSAGE}' => $msg_content, '{PLAINTEXT_MESSAGE}' => $message, '{SENDER_EMAIL}' => $sender_email, '{SENDER_NAME}' => $sender_name, '{VIEW_MORE_TGT}' => $CONFIG['ecards_more_pic_target'], '{VIEW_MORE_LNK}' => $lang_report_php['view_more_pics'], '{REASON}' => $reasons, '{COMMENT}' => $comment, '{COMMENT_ID}' => $cid, '{VIEW_COMMENT_LNK}' => $lang_report_php['view_comment'], '{COMMENT_TGT}' => "{$CONFIG['ecards_more_pic_target']}displayimage.php?pid={$pid}#comment{$cid}", '{PID}' => $pid);
$message = template_eval($template, $params);
$plaintext_message = template_eval($template_report_plaintext, $params);
开发者ID:CatBerg-TestOrg,项目名称:coppermine,代码行数:31,代码来源:report_file.php
示例11: process_post_data
function process_post_data()
{
global $HTTP_POST_VARS, $CONFIG;
global $user_albums_list, $lang_errors;
$user_album_set = array();
foreach ($user_albums_list as $album) {
$user_album_set[$album['aid']] = 1;
}
if (!is_array($HTTP_POST_VARS['pid'])) {
cpg_die(CRITICAL_ERROR, $lang_errors['param_missing'], __FILE__, __LINE__);
}
$pid_array =& $HTTP_POST_VARS['pid'];
foreach ($pid_array as $pid) {
$pid = (int) $pid;
$aid = (int) get_post_var('aid', $pid);
$title = get_post_var('title', $pid);
$caption = get_post_var('caption', $pid);
$keywords = get_post_var('keywords', $pid);
$user1 = get_post_var('user1', $pid);
$user2 = get_post_var('user2', $pid);
$user3 = get_post_var('user3', $pid);
$user4 = get_post_var('user4', $pid);
$delete = isset($HTTP_POST_VARS['delete' . $pid]);
$reset_vcount = isset($HTTP_POST_VARS['reset_vcount' . $pid]);
$reset_votes = isset($HTTP_POST_VARS['reset_votes' . $pid]);
$del_comments = isset($HTTP_POST_VARS['del_comments' . $pid]) || $delete;
$query = "SELECT category, filepath, filename FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND pid='{$pid}'";
$result = db_query($query);
if (!mysql_num_rows($result)) {
cpg_die(CRITICAL_ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
}
$pic = mysql_fetch_array($result);
mysql_free_result($result);
if (!GALLERY_ADMIN_MODE) {
if ($pic['category'] != FIRST_USER_CAT + USER_ID) {
cpg_die(ERROR, $lang_errors['perm_denied'] . "<br />(picture category = {$pic['category']}/ {$pid})", __FILE__, __LINE__);
}
if (!isset($user_album_set[$aid])) {
cpg_die(ERROR, $lang_errors['perm_denied'] . "<br />(target album = {$aid})", __FILE__, __LINE__);
}
}
$update = "aid = '" . $aid . "'";
$update .= ", title = '" . addslashes($title) . "'";
$update .= ", caption = '" . addslashes($caption) . "'";
$update .= ", keywords = '" . addslashes($keywords) . "'";
$update .= ", user1 = '" . addslashes($user1) . "'";
$update .= ", user2 = '" . addslashes($user2) . "'";
$update .= ", user3 = '" . addslashes($user3) . "'";
$update .= ", user4 = '" . addslashes($user4) . "'";
if (is_movie($pic['filename'])) {
$pwidth = get_post_var('pwidth', $pid);
$pheight = get_post_var('pheight', $pid);
$update .= ", pwidth = " . (int) $pwidth;
$update .= ", pheight = " . (int) $pheight;
}
if ($reset_vcount) {
$update .= ", hits = '0'";
}
if ($reset_votes) {
$update .= ", pic_rating = '0', votes = '0'";
}
if (UPLOAD_APPROVAL_MODE) {
$approved = get_post_var('approved', $pid);
if ($approved == 'YES') {
$update .= ", approved = 'YES'";
} elseif ($approved == 'DELETE') {
$del_comments = 1;
$delete = 1;
}
}
if ($del_comments) {
$query = "DELETE FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='{$pid}'";
$result = db_query($query);
}
if ($delete) {
$dir = $CONFIG['fullpath'] . $pic['filepath'];
$file = $pic['filename'];
if (!is_writable($dir)) {
cpg_die(CRITICAL_ERROR, sprintf($lang_errors['directory_ro'], $dir), __FILE__, __LINE__);
}
$files = array($dir . $file, $dir . $CONFIG['normal_pfx'] . $file, $dir . $CONFIG['thumb_pfx'] . $file);
foreach ($files as $currFile) {
if (is_file($currFile)) {
@unlink($currFile);
}
}
$query = "DELETE FROM {$CONFIG['TABLE_PICTURES']} WHERE pid='{$pid}' LIMIT 1";
$result = db_query($query);
} else {
$query = "UPDATE {$CONFIG['TABLE_PICTURES']} SET {$update} WHERE pid='{$pid}' LIMIT 1";
$result = db_query($query);
}
}
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:94,代码来源:editpics.php
示例12: edit_custom_course
function edit_custom_course()
{
$sem = get_post_var("semester");
$year = get_post_var("year");
$crn = get_post_var("crn");
$attribute = get_post_var("attribute");
$value = get_post_var("value");
return edit_custom_course($sem, $year, $crn, $attribute, $value);
}
开发者ID:op-erator,项目名称:banwebplus,代码行数:9,代码来源:ajax_calls.php
示例13: list
if (is_get_var('token') && is_get_var('ref') && get_get_var('ref') == 'deluser.php') {
list($name, $username, $password, $salt, $userProfile, $id, $record_to_del) = explode('[::]', unserialize(base64_decode($_GET['token'])));
$user = false;
}
if (plx_gu_session_authenticate($name, $username, $password, $remember, $user)) {
// Redirect to page that referred here - or to the home page
$redirect = is_get_var('ref') ? urldecode(get_get_var('ref')) . (is_get_var('token') ? '?token=' . get_get_var('token') : '') : absolute_url('index.php');
header('Location: ' . $redirect);
exit;
} else {
$name = '';
gu_error(t('Incorrect username or password'));
}
} elseif (is_get_var('action') && get_get_var('action') == 'login') {
$username = is_post_var('u') ? get_post_var('u') : '';
$password = is_post_var('p') ? get_post_var('p') : '';
$remember = is_post_var('login_remember');
if (gu_session_authenticate($username, $password, $remember)) {
// Redirect to page that referred here - or to the home page
$redirect = is_get_var('ref') ? urldecode(get_get_var('ref')) : absolute_url('index.php');
header('Location: ' . $redirect);
exit;
} else {
gu_error(t('Incorrect username or password'));
}
} elseif (is_get_var('action') && get_get_var('action') == 'logout') {
// Invalidate session flag
gu_session_set_valid(FALSE);
}
gu_theme_start();
?>
开发者ID:inscriptionweb,项目名称:gutuma,代码行数:31,代码来源:login.php
示例14: process_post_data
function process_post_data()
{
global $db, $CONFIG;
global $user_albums_list;
$user_album_set = array();
foreach ($user_albums_list as $album) {
$user_album_set[$album['aid']] = 1;
}
if (!is_array($_POST['pid'])) {
cpg_die(_CRITICAL_ERROR, PARAM_MISSING, __FILE__, __LINE__);
}
$pid_array =& $_POST['pid'];
foreach ($pid_array as $pid) {
//init.inc $pid = (int)$pid;
if (!is_numeric($aid . $pid)) {
cpg_die(_CRITICAL_ERROR, PARAM_MISSING, __FILE__, __LINE__);
}
$aid = get_post_var('aid', $pid);
$title = get_post_var('title', $pid);
$caption = get_post_var('caption', $pid, 1);
$keywords = get_post_var('keywords', $pid);
$user1 = get_post_var('user1', $pid);
$user2 = get_post_var('user2', $pid);
$user3 = get_post_var('user3', $pid);
$user4 = get_post_var('user4', $pid);
$delete = isset($_POST['delete' . $pid]);
$reset_vcount = isset($_POST['reset_vcount' . $pid]);
$reset_votes = isset($_POST['reset_votes' . $pid]);
$del_comments = isset($_POST['del_comments' . $pid]) || $delete;
$query = "SELECT category, filepath, filename FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND pid='{$pid}'";
$result = $db->sql_query($query);
if (!$db->sql_numrows($result)) {
cpg_die(_CRITICAL_ERROR, NON_EXIST_AP, __FILE__, __LINE__);
}
$pic = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!GALLERY_ADMIN_MODE) {
if ($pic['category'] != FIRST_USER_CAT + USER_ID) {
cpg_die(_ERROR, PERM_DENIED . "<br />(picture category = {$pic['category']}/ {$pid})", __FILE__, __LINE__);
}
if (!isset($user_album_set[$aid])) {
cpg_die(_ERROR, PERM_DENIED . "<br />(target album = {$aid})", __FILE__, __LINE__);
}
}
$update = "aid = '" . $aid . "' ";
$update .= ", title = '" . $title . " ' ";
$update .= ", caption = '" . $caption . "' ";
$update .= ", keywords = '" . $keywords . "' ";
$update .= ", user1 = '" . $user1 . "' ";
$update .= ", user2 = '" . $user2 . "' ";
$update .= ", user3 = '" . $user3 . "' ";
$update .= ", user4 = '" . $user4 . "' ";
if ($reset_vcount) {
$update .= ", hits = '0'";
}
if ($reset_votes) {
$update .= ", pic_rating = '0', votes = '0'";
}
if (UPLOAD_APPROVAL_MODE) {
$approved = get_post_var('approved', $pid);
if ($approved == '1') {
$update .= ", approved = '1'";
} elseif ($approved == 'DELETE') {
$del_comments = 1;
$delete = 1;
}
}
if ($del_comments) {
$result = $db->sql_query("DELETE FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='{$pid}'");
}
if ($delete) {
$dir = $CONFIG['fullpath'];
$file = $pic['filename'];
if (!is_writable($dir)) {
cpg_die(_CRITICAL_ERROR, sprintf(DIRECTORY_RO, $dir), __FILE__, __LINE__);
}
$files = array($dir . $file, $dir . $CONFIG['normal_pfx'] . $file, $dir . $CONFIG['thumb_pfx'] . $file);
foreach ($files as $currFile) {
if (is_file($currFile)) {
unlink($currFile);
}
}
$result = $db->sql_query("DELETE FROM {$CONFIG['TABLE_PICTURES']} WHERE pid='{$pid}'");
} else {
$result = $db->sql_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET {$update} WHERE pid='{$pid}'");
}
}
speedup_pictures();
}
开发者ID:cbsistem,项目名称:nexos,代码行数:89,代码来源:editpics.php
示例15: gu_init
/* Gutama plugin package
* @version 1.6
* @date 01/10/2013
* @author Cyril MAGUIRE
*/
include_once 'inc/gutuma.php';
include_once 'inc/subscription.php';
// Initialize Gutuma without validation or redirection
gu_init(FALSE, FALSE);
gu_theme_start('ok');
// If variables have been posted then they may have prefixes
$posted_address = '';
$posted_lists = array();
$posted_action = '';
foreach (array_keys($_POST) as $var) {
$val = get_post_var($var);
if (strpos($var, 'subscribe_address') !== FALSE) {
$posted_address = trim($val);
} elseif (strpos($var, 'subscribe_list') !== FALSE) {
$posted_lists = is_array($val) ? $val : ((int) $val != 0 ? array((int) $val) : array());
} elseif (strpos($var, 'unsubscribe_submit') !== FALSE) {
$posted_action = 'unsubscribe';
} elseif (strpos($var, 'subscribe_submit') !== FALSE) {
$posted_action = 'subscribe';
}
}
// Check if we've got what we need to do a posted (un)subscription
if ($posted_action != '' && $posted_address != '' && count($posted_lists) > 0) {
gu_subscription_process($posted_address, $posted_lists, $posted_action == 'subscribe');
}
// Get querystring variables
开发者ID:inscriptionweb,项目名称:gutuma,代码行数:31,代码来源:subscribe.php
示例16: gu_update
// If pluxml is used
if (isset($_profil['salt'])) {
$salt = $_profil['salt'];
} else {
$salt = gu_config::plx_charAleatoire();
}
// If settings already exist, go into update mode
$update_mode = gu_config::load();
// Check if everything is already up-to-date
$install_success = $update_mode && gu_config::get_version() == GUTUMA_VERSION_NUM;
if (!$install_success) {
// Run installtion or update script
if ($update_mode && is_post_var('update_submit')) {
$install_success = gu_update();
} elseif (!$update_mode && is_post_var('install_submit')) {
$install_success = gu_install(get_post_var('collective_name'), get_post_var('admin_username'), sha1($salt . md5(get_post_var('admin_password'))), get_post_var('admin_email'), $salt);
}
}
// Get title of page
if ($install_success) {
$title = t('Finished');
} elseif ($update_mode) {
$title = t('Update to Gutuma ') . GUTUMA_VERSION_NAME;
} else {
$title = t('Install Gutuma ') . GUTUMA_VERSION_NAME;
}
gu_theme_start();
// Output title
echo '<h2>' . $title . '</h2>';
gu_theme_messages();
if ($install_success) {
开发者ID:inscriptionweb,项目名称:gutuma,代码行数:31,代码来源:install.php
示例17: process_post_data
/**
* process_post_data()
*
* Function to process the form posted
*/
function process_post_data()
{
global $CONFIG, $user_albums_list, $lang_errors;
$superCage = Inspekt::makeSuperCage();
//Check if the form token is valid
if (!checkFormToken()) {
cpg_die(ERROR, $lang_errors['invalid_form_token'], __FILE__, __LINE__);
}
$user_album_set = array();
$result = cpg_db_query("SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = " . (FIRST_USER_CAT + USER_ID) . " OR owner = " . USER_ID . " OR uploads = 'YES'");
while ($row = $result->fetchAssoc()) {
$user_album_set[$row['aid']] = 1;
}
$result->free();
$pid_array = $superCage->post->getInt('pid');
if (!is_array($pid_array)) {
cpg_die(CRITICAL_ERROR, $lang_errors['param_missing'], __FILE__, __LINE__);
}
if ($superCage->post->keyExists('galleryicon')) {
$galleryicon = $superCage->post->getInt('galleryicon');
} else {
$galleryicon = '';
}
foreach ($pid_array as $pid) {
$aid = $superCage->post->getInt("aid{$pid}");
$title = get_post_var('title', $pid);
$caption = get_post_var('caption', $pid);
$keywords = get_post_var('keywords', $pid);
$user1 = get_post_var('user1', $pid);
$user2 = get_post_var('user2', $pid);
$user3 = get_post_var('user3', $pid);
$user4 = get_post_var('user4', $pid);
$delete = false;
$reset_vcount = false;
$reset_votes = false;
$del_comments = false;
$isgalleryicon = $galleryicon === $pid;
if ($superCage->post->keyExists('delete' . $pid)) {
$delete = $superCage->post->getInt('delete' . $pid);
}
if ($superCage->post->keyExists('reset_vcount' . $pid)) {
$reset_vcount = $superCage->post->getInt('reset_vcount' . $pid);
}
if ($superCage->post->keyExists('reset_votes' . $pid)) {
$reset_votes = $superCage->post->getInt('reset_votes' . $pid);
}
if ($superCage->post->keyExists('del_comments' . $pid)) {
$del_comments = $superCage->post->getInt('del_comments' . $pid);
}
// We will be selecting pid in the query as we need it in $pic array for the plugin filter
$query = "SELECT pid, category, filepath, filename, owner_id FROM {$CONFIG['TABLE_PICTURES']} AS p INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON a.aid = p.aid WHERE pid = {$pid}";
$result = cpg_db_query($query);
if (!$result->numRows()) {
cpg_die(CRITICAL_ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
}
$pic = $result->fetchAssoc(true);
if (!GALLERY_ADMIN_MODE && !MODERATOR_MODE && !USER_ADMIN_MODE && !user_is_allowed() && !$CONFIG['users_can_edit_pics']) {
if ($pic['category'] != FIRST_USER_CAT + USER_ID) {
cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
}
if (!isset($user_album_set[$aid])) {
cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
}
}
cpg_trim_keywords($keywords);
$update = "aid = '{$aid}'";
$up
|
请发表评论