本文整理汇总了PHP中admin::mail方法的典型用法代码示例。如果您正苦于以下问题:PHP admin::mail方法的具体用法?PHP admin::mail怎么用?PHP admin::mail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin
的用法示例。
在下文中一共展示了admin::mail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
$i++;
}
$database->query("UPDATE " . TABLE_PREFIX . "users SET password = '" . md5($new_pass) . "', last_reset = '" . time() . "' WHERE user_id = '" . $results_array['user_id'] . "'");
if ($database->is_error()) {
// Error updating database
$message = $database->get_error();
} else {
// Setup email to send
$mail_to = $email;
$mail_subject = $MESSAGE['SIGNUP2_SUBJECT_LOGIN_INFO'];
// Replace placeholders from language variable with values
$search = array('{LOGIN_DISPLAY_NAME}', '{LOGIN_WEBSITE_TITLE}', '{LOGIN_NAME}', '{LOGIN_PASSWORD}');
$replace = array($results_array['display_name'], WEBSITE_TITLE, $results_array['username'], $new_pass);
$mail_message = str_replace($search, $replace, $MESSAGE['SIGNUP2_BODY_LOGIN_FORGOT']);
// Try sending the email
if ($admin->mail(SERVER_EMAIL, $mail_to, $mail_subject, $mail_message)) {
$message = $MESSAGE['FORGOT_PASS_PASSWORD_RESET'];
$display_form = false;
} else {
$database->query("UPDATE " . TABLE_PREFIX . "users SET password = '" . $old_pass . "' WHERE user_id = '" . $results_array['user_id'] . "'");
$message = $MESSAGE['FORGOT_PASS_CANNOT_EMAIL'];
}
}
}
} else {
// Email doesn't exist, so tell the user
$message = $MESSAGE['FORGOT_PASS_EMAIL_NOT_FOUND'];
// and delete the wrong Email
$email = '';
}
} else {
示例2: realpath
}
}
// end include class.secure.php
global $TEXT;
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: text/html; charset:utf-8;");
// not needed, config is loaded with class.secure
// include realpath(dirname(__FILE__)).'/../../config.php';
include realpath(dirname(__FILE__)) . '/../../framework/class.admin.php';
$admin = new admin('Settings', 'settings_basic');
$curr_user_is_admin = in_array(1, $admin->get_groups_id());
if (!$curr_user_is_admin) {
echo "<div style='border: 2px solid #CC0000; padding: 5px; text-align: center; background-color: #ffbaba;'>You're not allowed to use this function!</div>";
exit;
}
$settings = array();
$sql = 'SELECT `name`, `value` FROM `' . TABLE_PREFIX . 'settings`';
if ($res_settings = $database->query($sql)) {
while ($row = $res_settings->fetchRow()) {
$settings[strtoupper($row['name'])] = $row['name'] != 'wbmailer_smtp_password' ? htmlspecialchars($row['value']) : $row['value'];
}
}
ob_clean();
// send mail
if ($admin->mail($settings['SERVER_EMAIL'], $settings['SERVER_EMAIL'], 'LEPTON PHP MAILER', $TEXT['WBMAILER_TESTMAIL_TEXT'])) {
echo "<div style='border: 2px solid #006600; padding: 5px; text-align: center; background-color: #dff2bf;'>", $TEXT['WBMAILER_TESTMAIL_SUCCESS'], "</div>";
} else {
$message = ob_get_clean();
echo "<div style='border: 2px solid #CC0000; padding: 5px; text-align: center; background-color: #ffbaba;'>", $TEXT['WBMAILER_TESTMAIL_FAILED'], "<br />{$message}<br /></div>";
}