本文整理汇总了PHP中write_log函数的典型用法代码示例。如果您正苦于以下问题:PHP write_log函数的具体用法?PHP write_log怎么用?PHP write_log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了write_log函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: Copyright
/**
|--------------------------------------------------------------------------|
| https://github.com/Bigjoos/ |
|--------------------------------------------------------------------------|
| Licence Info: GPL |
|--------------------------------------------------------------------------|
| Copyright (C) 2010 U-232 V5 |
|--------------------------------------------------------------------------|
| A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. |
|--------------------------------------------------------------------------|
| Project Leaders: Mindless, Autotron, whocares, Swizzles. |
|--------------------------------------------------------------------------|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
*/
function docleanup($data)
{
global $INSTALLER09, $queries, $mc1;
set_time_limit(1200);
ignore_user_abort(1);
//== Delete inactive user accounts
$secs = 350 * 86400;
$dt = TIME_NOW - $secs;
$maxclass = UC_STAFF;
sql_query("SELECT FROM users WHERE parked='no' AND status='confirmed' AND class < {$maxclass} AND last_access < {$dt}");
//== Delete parked user accounts
$secs = 675 * 86400;
// change the time to fit your needs
$dt = TIME_NOW - $secs;
$maxclass = UC_STAFF;
sql_query("SELECT FROM users WHERE parked='yes' AND status='confirmed' AND class < {$maxclass} AND last_access < {$dt}");
if ($queries > 0) {
write_log("Inactive Clean -------------------- Inactive Clean Complete using {$queries} queries--------------------");
}
if (false !== mysqli_affected_rows($GLOBALS["___mysqli_ston"])) {
$data['clean_desc'] = mysqli_affected_rows($GLOBALS["___mysqli_ston"]) . " items deleted/updated";
}
if ($data['clean_log']) {
cleanup_log($data);
}
}
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:43,代码来源:inactive_update.php
示例2: admin_updateServerTrafficSettings
/**
* Update server traffic settings.
*
* @param int $trafficLimit Monthly traffic limit
* @param int $trafficWarning Traffic warning
* @return bool TRUE on success FALSE otherwise
*/
function admin_updateServerTrafficSettings($trafficLimit, $trafficWarning)
{
$retVal = true;
if (!is_numeric($trafficLimit)) {
set_page_message(tr('Monthly traffic limit must be a number.'), 'error');
$retVal = false;
}
if (!is_numeric($trafficWarning)) {
set_page_message(tr('Monthly traffic warning must be a number.'), 'error');
$retVal = false;
}
if ($retVal && $trafficWarning > $trafficLimit) {
set_page_message(tr('Monthly traffic warning cannot be bigger than monthly traffic limit.'), 'error');
$retVal = false;
}
if ($retVal) {
/** @var $db_cfg iMSCP_Config_Handler_Db */
$dbConfig = iMSCP_Registry::get('dbConfig');
$dbConfig->SERVER_TRAFFIC_LIMIT = $trafficLimit;
$dbConfig->SERVER_TRAFFIC_WARN = $trafficWarning;
// gets the number of queries that were been executed
$updtCount = $dbConfig->countQueries('update');
$newCount = $dbConfig->countQueries('insert');
// An Update was been made in the database ?
if ($updtCount || $newCount) {
set_page_message(tr('Server traffic settings successfully updated.', $updtCount), 'success');
write_log("{$_SESSION['user_logged']} updated server traffic settings.", E_USER_NOTICE);
} else {
set_page_message(tr("Nothing has been changed."), 'info');
}
}
return $retVal;
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:40,代码来源:settings_server_traffic.php
示例3: docleanup
function docleanup($data)
{
global $INSTALLER09, $queries, $mc1;
set_time_limit(1200);
ignore_user_abort(1);
//== delete torrents - ????
$days = 30;
$dt = TIME_NOW - $days * 86400;
sql_query("UPDATE torrents SET flags='1' WHERE added < {$dt} AND seeders='0' AND leechers='0'") or sqlerr(__FILE__, __LINE__);
$res = sql_query("SELECT id, name FROM torrents WHERE mtime < {$dt} AND seeders='0' AND leechers='0' AND flags='1'") or sqlerr(__FILE__, __LINE__);
while ($arr = mysqli_fetch_assoc($res)) {
sql_query("DELETE files.*, comments.*, thankyou.*, thanks.*, thumbsup.*, bookmarks.*, coins.*, rating.*, xbt_files_users.* FROM xbt_files_users\n LEFT JOIN files ON files.torrent = xbt_files_users.fid\n LEFT JOIN comments ON comments.torrent = xbt_files_users.fid\n LEFT JOIN thankyou ON thankyou.torid = xbt_files_users.fid\n LEFT JOIN thanks ON thanks.torrentid = xbt_files_users.fid\n LEFT JOIN bookmarks ON bookmarks.torrentid = xbt_files_users.fid\n LEFT JOIN coins ON coins.torrentid = xbt_files_users.fid\n LEFT JOIN rating ON rating.torrent = xbt_files_users.fid\n LEFT JOIN thumbsup ON thumbsup.torrentid = xbt_files_users.fid\n WHERE xbt_files_users.fid =" . sqlesc($arr['id'])) or sqlerr(__FILE__, __LINE__);
@unlink("{$INSTALLER09['torrent_dir']}/{$arr['id']}.torrent");
write_log("Torrent " . (int) $arr['id'] . " (" . htmlsafechars($arr['name']) . ") was deleted by system (older than {$days} days and no seeders)");
}
if ($queries > 0) {
write_log("Delete Old Torrents XBT Clean -------------------- Delete Old XBT Torrents cleanup Complete using {$queries} queries --------------------");
}
if (false !== mysqli_affected_rows($GLOBALS["___mysqli_ston"])) {
$data['clean_desc'] = mysqli_affected_rows($GLOBALS["___mysqli_ston"]) . " items deleted/updated";
}
if ($data['clean_log']) {
cleanup_log($data);
}
}
开发者ID:UniversalAdministrator,项目名称:U-232-V4,代码行数:25,代码来源:delete_torrents_xbt_update.php
示例4: view_forgetPost
public function view_forgetPost()
{
$act = A('Login');
$sendEmail = A('Public')->act_sendEmail("checkPassword");
if ($sendEmail) {
$email = isset($_REQUEST['email']) ? trim($_REQUEST['email']) : '';
$mailType = explode("@", $email);
$emailAddrs = C('EMAILADDRESS');
//替换特殊邮箱edu
$splitArray = explode(".", $mailType[1]);
if (in_array("edu", $splitArray)) {
$mailType[1] = str_replace($splitArray[0], "**", $mailType[1]);
$emailAddrs[$mailType[1]] = str_replace("**", $splitArray[0], $emailAddrs[$mailType[1]]);
}
if (!empty($emailAddrs[$mailType[1]])) {
$this->smarty->assign('emailAddress', $emailAddrs[$mailType[1]]);
$this->smarty->assign('email', $email);
} else {
write_log(WEB_PATH . "log/noCachedEmail.log", $mailType[1]);
$this->smarty->assign('emailAddress', "unknown");
$this->smarty->assign('email', $email);
}
$this->smarty->assign('flag', "sendEmailOk");
} else {
$this->smarty->assign('flag', "checkEmailNo");
}
$this->smarty->display('forgotPassword.html');
}
开发者ID:bizonix,项目名称:sailvan,代码行数:28,代码来源:login.view.php
示例5: docleanup
function docleanup($data)
{
global $INSTALLER09, $queries, $mc1;
set_time_limit(1200);
ignore_user_abort(1);
sql_query("UPDATE `freeslots` SET `addedup` = 0 WHERE `addedup` != 0 AND `addedup` < " . TIME_NOW) or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE `freeslots` SET `addedfree` = 0 WHERE `addedfree` != 0 AND `addedfree` < " . TIME_NOW) or sqlerr(__FILE__, __LINE__);
sql_query("DELETE FROM `freeslots` WHERE `addedup` = 0 AND `addedfree` = 0") or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE `users` SET `free_switch` = 0 WHERE `free_switch` > 1 AND `free_switch` < " . TIME_NOW) or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE `torrents` SET `free` = 0 WHERE `free` > 1 AND `free` < " . TIME_NOW) or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE `users` SET `downloadpos` = 1 WHERE `downloadpos` > 1 AND `downloadpos` < " . TIME_NOW) or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE `users` SET `uploadpos` = 1 WHERE `uploadpos` > 1 AND `uploadpos` < " . TIME_NOW) or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE `users` SET `chatpost` = 1 WHERE `chatpost` > 1 AND `chatpost` < " . TIME_NOW) or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE `users` SET `avatarpos` = 1 WHERE `avatarpos` > 1 AND `avatarpos` < " . TIME_NOW) or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE `users` SET `immunity` = 0 WHERE `immunity` > 1 AND `immunity` < " . TIME_NOW) or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE `users` SET `warned` = 0 WHERE `warned` > 1 AND `warned` < " . TIME_NOW) or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE `users` SET `pirate` = 0 WHERE `pirate` > 1 AND `pirate` < " . TIME_NOW) or sqlerr(__FILE__, __LINE__);
sql_query("UPDATE `users` SET `king` = 0 WHERE `king` > 1 AND `king` < " . TIME_NOW) or sqlerr(__FILE__, __LINE__);
if ($queries > 0) {
write_log("User Clean -------------------- User Clean Complete using {$queries} queries--------------------");
}
if (false !== mysqli_affected_rows($GLOBALS["___mysqli_ston"])) {
$data['clean_desc'] = mysqli_affected_rows($GLOBALS["___mysqli_ston"]) . " items deleted/updated";
}
if ($data['clean_log']) {
cleanup_log($data);
}
}
开发者ID:CharlieHD,项目名称:U-232-V3,代码行数:28,代码来源:user_update.php
示例6: padd_group
function padd_group($tpl, $sql, $dmn_id)
{
$cfg = EasySCP_Registry::get('Config');
if (isset($_POST['uaction']) && $_POST['uaction'] == 'add_group') {
// we have to add the group
if (isset($_POST['groupname'])) {
if (!validates_username($_POST['groupname'])) {
set_page_message(tr('Invalid group name!'), 'warning');
return;
}
$groupname = $_POST['groupname'];
$query = "\n\t\t\t\tSELECT\n\t\t\t\t\t`id`\n\t\t\t\tFROM\n\t\t\t\t\t`htaccess_groups`\n\t\t\t\tWHERE\n\t\t\t\t\t`ugroup` = ?\n\t\t\t\tAND\n\t\t\t\t\t`dmn_id` = ?\n\t\t\t";
$rs = exec_query($sql, $query, array($groupname, $dmn_id));
if ($rs->recordCount() == 0) {
$change_status = $cfg->ITEM_ADD_STATUS;
$query = "\n\t\t\t\t\tINSERT INTO `htaccess_groups`\n\t\t\t\t\t\t(`dmn_id`, `ugroup`, `status`)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t(?, ?, ?)\n\t\t\t\t";
exec_query($sql, $query, array($dmn_id, $groupname, $change_status));
send_request();
$admin_login = $_SESSION['user_logged'];
write_log("{$admin_login}: add group (protected areas): {$groupname}");
user_goto('protected_user_manage.php');
} else {
set_page_message(tr('Group already exists!'), 'error');
return;
}
} else {
set_page_message(tr('Invalid group name!'), 'error');
return;
}
} else {
return;
}
}
开发者ID:gOOvER,项目名称:EasySCP,代码行数:33,代码来源:protected_group_add.php
示例7: add_ip
function add_ip(&$tpl, &$sql)
{
global $ip_number_1, $ip_number_2, $ip_number_3, $ip_number_4;
global $domain, $alias;
if (isset($_POST['uaction']) && $_POST['uaction'] === 'add_ip') {
if (check_user_data()) {
//add ip
global $ip_number_1, $ip_number_2, $ip_number_3, $ip_number_4;
$ip_number = trim($ip_number_1) . '.' . trim($ip_number_2) . '.' . trim($ip_number_3) . '.' . trim($ip_number_4);
$query = <<<SQL_QUERY
insert into server_ips
(ip_number,ip_domain,ip_alias)
values
(?,?,?)
SQL_QUERY;
$rs = exec_query($sql, $query, array($ip_number, htmlspecialchars($domain, ENT_QUOTES, "UTF-8"), htmlspecialchars($alias, ENT_QUOTES, "UTF-8")));
set_page_message(tr('New IP was added!'));
$user_logged = $_SESSION['user_logged'];
write_log("{$user_logged}: add new IP4 address: {$ip_number}");
}
$tpl->assign(array('VALUE_IP1' => $_POST['ip_number_1'], 'VALUE_IP2' => $_POST['ip_number_2'], 'VALUE_IP3' => $_POST['ip_number_3'], 'VALUE_IP4' => $_POST['ip_number_4'], 'VALUE_DOMAIN' => $_POST['domain'], 'VALUE_ALIAS' => $_POST['alias']));
} else {
$tpl->assign(array('VALUE_IP1' => '', 'VALUE_IP2' => '', 'VALUE_IP3' => '', 'VALUE_IP4' => '', 'VALUE_DOMAIN' => '', 'VALUE_ALIAS' => ''));
}
}
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:25,代码来源:ip_manage.php
示例8: Copyright
/**
|--------------------------------------------------------------------------|
| https://github.com/Bigjoos/ |
|--------------------------------------------------------------------------|
| Licence Info: GPL |
|--------------------------------------------------------------------------|
| Copyright (C) 2010 U-232 V5 |
|--------------------------------------------------------------------------|
| A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. |
|--------------------------------------------------------------------------|
| Project Leaders: Mindless, Autotron, whocares, Swizzles. |
|--------------------------------------------------------------------------|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
*/
function docleanup($data)
{
global $INSTALLER09, $queries, $mc1;
set_time_limit(0);
ignore_user_abort(1);
//=== Clean silver
$res = sql_query("SELECT id, silver FROM torrents WHERE silver > 1 AND silver < " . TIME_NOW) or sqlerr(__FILE__, __LINE__);
$Silver_buffer = array();
if (mysqli_num_rows($res) > 0) {
while ($arr = mysqli_fetch_assoc($res)) {
$Silver_buffer[] = '(' . $arr['id'] . ', \'0\')';
$mc1->begin_transaction('torrent_details_' . $arr['id']);
$mc1->update_row(false, array('silver' => 0));
$mc1->commit_transaction($INSTALLER09['expires']['torrent_details']);
}
$count = count($Silver_buffer);
if ($count > 0) {
sql_query("INSERT INTO torrents (id, silver) VALUES " . implode(', ', $Silver_buffer) . " ON DUPLICATE key UPDATE silver=values(silver)") or sqlerr(__FILE__, __LINE__);
write_log("Cleanup - Removed Silver from " . $count . " torrents");
}
unset($Silver_buffer, $count);
}
//==End
if ($queries > 0) {
write_log("Free clean-------------------- Silver Torrents cleanup Complete using {$queries} queries --------------------");
}
if (false !== mysqli_affected_rows($GLOBALS["___mysqli_ston"])) {
$data['clean_desc'] = mysqli_affected_rows($GLOBALS["___mysqli_ston"]) . " items updated";
}
if ($data['clean_log']) {
cleanup_log($data);
}
}
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:50,代码来源:silvertorrents_update.php
示例9: scrape
function scrape($url, $infohash = '')
{
global $TABLE_PREFIX, $BASEDIR;
if (isset($url)) {
$url_c = parse_url($url);
if (!isset($url_c["port"]) || empty($url_c["port"])) {
$url_c["port"] = 80;
}
require_once $BASEDIR . "/phpscraper/" . $url_c["scheme"] . "tscraper.php";
try {
$timeout = 5;
if ($url_c["scheme"] == "udp") {
$scraper = new udptscraper($timeout);
} else {
$scraper = new httptscraper($timeout);
}
$ret = $scraper->scrape($url_c["scheme"] . "://" . $url_c["host"] . ":" . $url_c["port"] . ($url_c["scheme"] == "udp" ? "" : "/announce"), array($infohash));
do_sqlquery("UPDATE `{$TABLE_PREFIX}files` SET `lastupdate`=NOW(), `lastsuccess`=NOW(), `seeds`=" . $ret[$infohash]["seeders"] . ", `leechers`=" . $ret[$infohash]["leechers"] . ", `finished`=" . $ret[$infohash]["completed"] . " WHERE `announce_url` = '" . $url . "'" . ($infohash == "" ? "" : " AND `info_hash`='" . $infohash . "'"), true);
if (mysqli_affected_rows($GLOBALS["___mysqli_ston"]) == 1) {
write_log('SUCCESS update external torrent from ' . $url . ' tracker (infohash: ' . $infohash . ')', '');
}
} catch (ScraperException $e) {
write_log("FAILED update external torrent " . ($infohash == "" ? "" : "(infohash: " . $infohash . ")") . " from " . $url . " tracker (" . $e->getMessage() . "))", "");
}
return;
}
return;
}
开发者ID:Karpec,项目名称:gizd,代码行数:28,代码来源:getscrape_single.php
示例10: client_addHtaccessGroup
/**
* Adds Htaccess group.
*
* @param int $domainId Domain unique identifier
* @return
*/
function client_addHtaccessGroup($domainId)
{
if (isset($_POST['uaction']) && $_POST['uaction'] == 'add_group') {
// we have to add the group
if (isset($_POST['groupname'])) {
if (!validates_username($_POST['groupname'])) {
set_page_message(tr('Invalid group name!'), 'error');
return;
}
$groupname = $_POST['groupname'];
$query = "\n\t\t\t\tSELECT\n\t\t\t\t\t`id`\n\t\t\t\tFROM\n\t\t\t\t\t`htaccess_groups`\n\t\t\t\tWHERE\n\t\t\t\t\t`ugroup` = ?\n\t\t\t\tAND\n\t\t\t\t\t`dmn_id` = ?\n\t\t\t";
$rs = exec_query($query, array($groupname, $domainId));
if ($rs->rowCount() == 0) {
$change_status = 'toadd';
$query = "\n\t\t\t\t\tINSERT INTO `htaccess_groups` (\n\t\t\t\t\t `dmn_id`, `ugroup`, `status`\n\t\t\t\t\t) VALUES (\n\t\t\t\t\t ?, ?, ?\n\t\t\t\t\t)\n\t\t\t\t";
exec_query($query, array($domainId, $groupname, $change_status));
send_request();
set_page_message(tr('Htaccess group successfully scheduled for addition.'), 'success');
$admin_login = $_SESSION['user_logged'];
write_log("{$admin_login}: added htaccess group: {$groupname}", E_USER_NOTICE);
redirectTo('protected_user_manage.php');
} else {
set_page_message(tr('This htaccess group already exists.'), 'error');
return;
}
} else {
set_page_message(tr('Invalid htaccess group name.'), 'error');
return;
}
} else {
return;
}
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:39,代码来源:protected_group_add.php
示例11: log_result
private function log_result($text, $res)
{
if ($res != true) {
write_log('errors', "{$text}:");
write_log('errors', $res);
}
}
开发者ID:posteo,项目名称:mailvelope_client,代码行数:7,代码来源:mailvelope_client.php
示例12: get_images
function get_images($url, $image_dir, $image_name)
{
// echo $image_name . '<br/>';
$savefile = $image_dir . "/" . $image_name;
try {
$ch = curl_init($url);
$fp = fopen($savefile, "wb");
if (!$fp) {
write_log('Не удалось открыть файл для сохранения изображения ' . $url);
}
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
$filesize = filesize($savefile);
if ($filesize > 0) {
return TRUE;
} else {
return FALSE;
}
} catch (Exception $exc) {
// echo $exc->getTraceAsString();
return FALSE;
}
}
开发者ID:pilipchuk72,项目名称:panda2,代码行数:26,代码来源:controler.php
示例13: Copyright
/**
|--------------------------------------------------------------------------|
| https://github.com/Bigjoos/ |
|--------------------------------------------------------------------------|
| Licence Info: GPL |
|--------------------------------------------------------------------------|
| Copyright (C) 2010 U-232 V5 |
|--------------------------------------------------------------------------|
| A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. |
|--------------------------------------------------------------------------|
| Project Leaders: Mindless, Autotron, whocares, Swizzles. |
|--------------------------------------------------------------------------|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
*/
function docleanup($data)
{
global $INSTALLER09, $queries, $mc1;
set_time_limit(0);
ignore_user_abort(1);
require_once INCL_DIR . 'function_happyhour.php';
//==Putyns HappyHour
$f = $INSTALLER09['happyhour'];
$happy = unserialize(file_get_contents($f));
$happyHour = strtotime($happy["time"]);
$curDate = TIME_NOW;
$happyEnd = $happyHour + 3600;
if ($happy["status"] == 0 && $INSTALLER09['happy_hour'] == true) {
write_log("Happy hour was @ " . get_date($happyHour, 'LONG', 1, 0) . " and Catid " . $happy["catid"] . " ");
happyFile("set");
} elseif ($curDate > $happyEnd && $happy["status"] == 1) {
happyFile("reset");
}
//== End
if ($queries > 0) {
write_log("Happyhour Clean -------------------- Happyhour cleanup Complete using {$queries} queries --------------------");
}
if (false !== mysqli_affected_rows($GLOBALS["___mysqli_ston"])) {
$data['clean_desc'] = mysqli_affected_rows($GLOBALS["___mysqli_ston"]) . " items deleted/updated";
}
if ($data['clean_log']) {
cleanup_log($data);
}
}
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:46,代码来源:happyhour_update.php
示例14: client_updateAutoresponder
/**
* Update autoresponder of the given mail account
*
* @param int $mailAccountId Mail account id
* @param string $autoresponderMessage Auto-responder message
* @return void
*/
function client_updateAutoresponder($mailAccountId, $autoresponderMessage)
{
$autoresponderMessage = clean_input($autoresponderMessage);
if ($autoresponderMessage == '') {
set_page_message(tr('Auto-responder message cannot be empty.'), 'error');
redirectTo("mail_autoresponder_enable.php?mail_account_id={$mailAccountId}");
} else {
$db = iMSCP_Database::getInstance();
try {
$db->beginTransaction();
$query = "SELECT `mail_addr` FROM `mail_users` WHERE `mail_id` = ?";
$stmt = exec_query($query, $mailAccountId);
$query = "UPDATE `mail_users` SET `status` = ?, `mail_auto_respond_text` = ? WHERE `mail_id` = ?";
exec_query($query, array('tochange', $autoresponderMessage, $mailAccountId));
// Purge autoreplies log entries
delete_autoreplies_log_entries();
$db->commit();
// Ask iMSCP daemon to trigger engine dispatcher
send_request();
write_log(sprintf("%s: Updated auto-responder for the '%s' mail account", $_SESSION['user_logged'], $stmt->fields['mail_addr']), E_USER_NOTICE);
set_page_message(tr('Auto-responder successfully scheduled for update.'), 'success');
} catch (iMSCP_Exception_Database $e) {
$db->rollBack();
throw $e;
}
}
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:34,代码来源:mail_autoresponder_edit.php
示例15: gen_page_dynamic_data
function gen_page_dynamic_data(&$tpl, &$sql, $mail_id)
{
global $cfg;
if (isset($_POST['uaction']) && $_POST['uaction'] === 'enable_arsp') {
if ($_POST['arsp_message'] === '') {
$tpl->assign('ARSP_MESSAGE', '');
set_page_message(tr('Please type your mail autorespond message!'));
return;
}
$arsp_message = $_POST['arsp_message'];
$item_change_status = $cfg['ITEM_CHANGE_STATUS'];
check_for_lock_file();
$query = <<<SQL_QUERY
update
mail_users
set
status = ?,
mail_auto_respond = ?
where
mail_id = ?
SQL_QUERY;
$rs = exec_query($sql, $query, array($item_change_status, $arsp_message, $mail_id));
send_request();
write_log($_SESSION['user_logged'] . " : add mail autorsponder");
set_page_message(tr('Mail account scheduler for modification!'));
header("Location: email_accounts.php");
exit(0);
} else {
$tpl->assign('ARSP_MESSAGE', '');
}
}
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:31,代码来源:enable_mail_arsp.php
示例16: my_query
function my_query($str_query, $conex)
{
global $conf_db_type, $conf_is_prod;
$queries2log = array('UPD', 'DEL', 'DRO', 'ALT', 'TRU');
if (in_array(strtoupper(substr($str_query, 0, 3)), $queries2log) && !$conf_is_prod) {
@write_log('db_trans', $str_query);
}
switch ($conf_db_type) {
case 'mysql':
$res = @mysql_query($str_query, $conex);
if ($res) {
return $res;
} else {
write_log('db_error', mysql_error() . " ----> " . $str_query);
}
break;
case 'mssql':
$res = @mssql_query($str_query, $conex);
if ($res) {
return $res;
} else {
write_log('db_error', mssql_get_last_message() . " ----> " . $str_query);
}
break;
}
}
开发者ID:javiercaceres77,项目名称:rooms,代码行数:26,代码来源:connect.php
示例17: scheduleBackupRestoration
/**
* Schedule backup restoration.
*
* @param int $userId Customer unique identifier
* @return void
*/
function scheduleBackupRestoration($userId)
{
exec_query("UPDATE `domain` SET `domain_status` = ? WHERE `domain_admin_id` = ?", array('torestore', $userId));
send_request();
write_log($_SESSION['user_logged'] . ": scheduled backup restoration.", E_USER_NOTICE);
set_page_message(tr('Backup has been successfully scheduled for restoration.'), 'success');
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:13,代码来源:backup.php
示例18: Copyright
/**
|--------------------------------------------------------------------------|
| https://github.com/Bigjoos/ |
|--------------------------------------------------------------------------|
| Licence Info: GPL |
|--------------------------------------------------------------------------|
| Copyright (C) 2010 U-232 V4 |
|--------------------------------------------------------------------------|
| A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. |
|--------------------------------------------------------------------------|
| Project Leaders: Mindless,putyn. |
|--------------------------------------------------------------------------|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
*/
function docleanup($data)
{
global $INSTALLER09, $queries, $mc1;
set_time_limit(0);
ignore_user_abort(1);
$deadtime = TIME_NOW - $INSTALLER09['signup_timeout'];
$res = sql_query("SELECT id, username, added, downloaded, uploaded, last_access, class, donor, warned, enabled, status FROM users WHERE status = 'pending' AND added < {$deadtime} AND last_login < {$deadtime} AND last_access < {$deadtime} ORDER BY username DESC");
if (mysqli_num_rows($res) != 0) {
while ($arr = mysqli_fetch_assoc($res)) {
$userid = $arr['id'];
$res_del = sql_query("DELETE FROM users WHERE id=" . sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
$mc1->delete_value('MyUser_' . $userid);
$mc1->delete_value('user' . $userid);
write_log("User: {$arr['username']} Was deleted by Expired Signup clean");
}
}
if ($queries > 0) {
write_log("Expired Signup clean-------------------- Expired Signup cleanup Complete using {$queries} queries --------------------");
}
if (false !== mysqli_affected_rows($GLOBALS["___mysqli_ston"])) {
$data['clean_desc'] = mysqli_affected_rows($GLOBALS["___mysqli_ston"]) . " items deleted/updated";
}
if ($data['clean_log']) {
cleanup_log($data);
}
}
开发者ID:UniversalAdministrator,项目名称:U-232-V4,代码行数:43,代码来源:expired_signup_update.php
示例19: view_registerLocation
public function view_registerLocation()
{
$flag = $_REQUEST['flag'];
$email = trim($_REQUEST['email']);
if ($flag == "resend") {
$sendStatus = A('Public')->act_sendEmail("checkRegister");
if ($sendStatus) {
$flag = 'resendOk';
} else {
$flag = 'resendError';
}
}
$mailType = explode("@", $email);
$emailAddrs = C('EMAILADDRESS');
//替换特殊邮箱edu
$splitArray = explode(".", $mailType[1]);
if (in_array("edu", $splitArray)) {
$mailType[1] = str_replace($splitArray[0], "**", $mailType[1]);
$emailAddrs[$mailType[1]] = str_replace("**", $splitArray[0], $emailAddrs[$mailType[1]]);
}
if (!empty($emailAddrs[$mailType[1]])) {
$this->smarty->assign('emailAddress', $emailAddrs[$mailType[1]]);
} else {
write_log(WEB_PATH . "log/noCachedEmail.log", $mailType[1]);
$this->smarty->assign('emailAddress', "unknown");
}
$this->smarty->assign("flag", $flag);
$this->smarty->assign("email", $email);
$this->smarty->display('registerLocation.html');
}
开发者ID:bizonix,项目名称:sailvan,代码行数:30,代码来源:register.view.php
示例20: client_updateHtaccessUser
/**
* Updates htaccess user.
*
* @param int $dmn_id Domain unique identifier
* @param int $uuser_id Htaccess user unique identifier
* @return
*/
function client_updateHtaccessUser(&$dmn_id, &$uuser_id)
{
if (isset($_POST['uaction']) && $_POST['uaction'] == 'modify_user') {
// we have to add the user
if (isset($_POST['pass']) && isset($_POST['pass_rep'])) {
if (!checkPasswordSyntax($_POST['pass'])) {
return;
}
if ($_POST['pass'] !== $_POST['pass_rep']) {
set_page_message(tr("Passwords do not match."), 'error');
return;
}
$nadmin_password = cryptPasswordWithSalt($_POST['pass'], generateRandomSalt(true));
$change_status = 'tochange';
$query = "\n\t\t\t\tUPDATE\n\t\t\t\t\t`htaccess_users`\n\t\t\t\tSET\n\t\t\t\t\t`upass` = ?, `status` = ?\n\t\t\t\tWHERE\n\t\t\t\t\t`dmn_id` = ?\n\t\t\t\tAND\n\t\t\t\t\t`id` = ?\n\t\t\t";
exec_query($query, array($nadmin_password, $change_status, $dmn_id, $uuser_id));
send_request();
$query = "\n\t\t\t\tSELECT\n\t\t\t\t\t`uname`\n\t\t\t\tFROM\n\t\t\t\t\t`htaccess_users`\n\t\t\t\tWHERE\n\t\t\t\t\t`dmn_id` = ?\n\t\t\t\tAND\n\t\t\t\t\t`id` = ?\n\t\t\t";
$rs = exec_query($query, array($dmn_id, $uuser_id));
$uname = $rs->fields['uname'];
$admin_login = $_SESSION['user_logged'];
write_log("{$admin_login}: updated htaccess user ID: {$uname}", E_USER_NOTICE);
redirectTo('protected_user_manage.php');
}
} else {
return;
}
}
开发者ID:svenjantzen,项目名称:imscp,代码行数:35,代码来源:protected_user_edit.php
注:本文中的write_log函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论