• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP my_mail函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中my_mail函数的典型用法代码示例。如果您正苦于以下问题:PHP my_mail函数的具体用法?PHP my_mail怎么用?PHP my_mail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了my_mail函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: run_task

/**
 * Execute a scheduled task.
 *
 * @param int $tid The task ID. If none specified, the next task due to be ran is executed
 * @return boolean True if successful, false on failure
 */
function run_task($tid = 0)
{
    global $db, $mybb, $cache, $plugins, $task, $lang;
    // Run a specific task
    if ($tid > 0) {
        $query = $db->simple_select("tasks", "*", "tid='{$tid}'");
        $task = $db->fetch_array($query);
    } else {
        $query = $db->simple_select("tasks", "*", "enabled=1 AND nextrun<='" . TIME_NOW . "'", array("order_by" => "nextrun", "order_dir" => "asc", "limit" => 1));
        $task = $db->fetch_array($query);
    }
    // No task? Return
    if (!$task['tid']) {
        $cache->update_tasks();
        return false;
    }
    // Is this task still running and locked less than 5 minutes ago? Well don't run it now - clearly it isn't broken!
    if ($task['locked'] != 0 && $task['locked'] > TIME_NOW - 300) {
        $cache->update_tasks();
        return false;
    } else {
        $db->update_query("tasks", array("locked" => TIME_NOW), "tid='{$task['tid']}'");
    }
    // The task file does not exist
    if (!file_exists(MYBB_ROOT . "inc/tasks/{$task['file']}.php")) {
        if ($task['logging'] == 1) {
            add_task_log($task, $lang->missing_task);
        }
        // If task file does not exist, disable task and inform the administrator
        $updated_task = array("enabled" => 0, "locked" => 0);
        $db->update_query("tasks", $updated_task, "tid='{$task['tid']}'");
        $subject = $lang->sprintf($lang->email_broken_task_subject, $mybb->settings['bbname']);
        $message = $lang->sprintf($lang->email_broken_task, $mybb->settings['bbname'], $mybb->settings['bburl'], $task['title']);
        my_mail($mybb->settings['adminemail'], $subject, $message, $mybb->settings['adminemail']);
        $cache->update_tasks();
        return false;
    } else {
        // Update the nextrun time now, so if the task causes a fatal error, it doesn't get stuck first in the queue
        $nextrun = fetch_next_run($task);
        $db->update_query("tasks", array("nextrun" => $nextrun), "tid='{$task['tid']}'");
        include_once MYBB_ROOT . "inc/tasks/{$task['file']}.php";
        $function = "task_{$task['file']}";
        if (function_exists($function)) {
            $function($task);
        }
    }
    $updated_task = array("lastrun" => TIME_NOW, "locked" => 0);
    $db->update_query("tasks", $updated_task, "tid='{$task['tid']}'");
    $cache->update_tasks();
    return true;
}
开发者ID:styv300,项目名称:ToRepublic2.5,代码行数:57,代码来源:functions_task.php


示例2: send_contact

function send_contact()
{
    global $realname, $company, $address, $address2, $address3, $postcode, $country;
    global $telephone, $email, $comments;
    //	$mail_to="[email protected]"
    $mail_to = "[email protected]";
    $mail_subject = "Henry Taunt Footsteps support";
    $mail_body = "\tCONTACT DETAILS\n\nFeedback from Henry Taunt Footsteps website:\n\n";
    $mail_body .= $realname . "\n" . $company . "\n";
    $mail_body .= $address . "\n" . $address2 . "\n" . $address3 . "\n" . $postcode . "\n" . $country . "\n\n";
    $mail_body .= "Phone - " . $telephone . "\n" . "E-mail - " . $email . "\n\n";
    $mail_body .= "Comments:" . "\n" . $comments . "\n\n";
    $mail_parts["mail_to"] = $mail_to;
    $mail_parts["mail_subject"] = $mail_subject;
    $mail_parts["mail_body"] = $mail_body;
    if (my_mail($mail_parts)) {
        user_message("You have just successfully sent to INVC an e-mail titled '{$mail_subject}'.", 2);
    } else {
        error_message("An unknown error occurred while attempting to send an e-mail titled '{$mail_subject}'.");
    }
}
开发者ID:HenryTaunt,项目名称:InTheFootstepsOf,代码行数:21,代码来源:mailer.php


示例3: random_str

            $verified = false;
            $db->delete_query("awaitingactivation", "uid='{$user['uid']}' AND type='p'");
            $user['activationcode'] = random_str();
            $now = TIME_NOW;
            $uid = $user['uid'];
            $awaitingarray = array("uid" => $user['uid'], "dateline" => TIME_NOW, "code" => $user['activationcode'], "type" => "p");
            $db->insert_query("awaitingactivation", $awaitingarray);
            $username = $user['username'];
            $email = $user['email'];
            $activationcode = $user['activationcode'];
            $emailsubject = $lang->sprintf($lang->emailsubject_lostpw, $mybb->settings['bbname']);
            switch ($mybb->settings['username_method']) {
                case 0:
                    $emailmessage = $lang->sprintf($lang->email_lostpw, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode);
                    break;
                case 1:
                    $emailmessage = $lang->sprintf($lang->email_lostpw1, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode);
                    break;
                case 2:
                    $emailmessage = $lang->sprintf($lang->email_lostpw2, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode);
                    break;
                default:
                    $emailmessage = $lang->sprintf($lang->email_lostpw, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode);
                    break;
            }
            my_mail($email, $emailsubject, $emailmessage);
            $plugins->run_hooks("member_do_lostpw_end");
            $result_text = $lang->redirect_lostpwsent;
        }
    }
}
开发者ID:dthiago,项目名称:tapatalk-mybb,代码行数:31,代码来源:member.php


示例4: send_forgot_password

    public function send_forgot_password($email)
    {
        $this->db->select()->from('users')->where('email', $email);
        $query = $this->db->get();
        if ($query->num_rows() == 0) {
            $data['status'] = "Error";
            $data['message'] = "This email is not registered with us";
        } else {
            $result = $query->result_array();
            $result = $result[0];
            $token = md5(rand() . microtime() . rand()) . md5(time());
            $value['email'] = $email;
            $value['token'] = $token;
            $value['used'] = '0';
            $this->db->insert('lost_password', $value);
            $data['status'] = "Success";
            $data['message'] = "Reset link sent, please check email";
            $this->load->helper('mail_helper');
            $baseurl = base_url();
            $user_name = $result['name'];
            $user_id = $result['id'];
            $body = <<<MARKUP
\t\t\tWelcome {$user_name}, please click on this <a href='{$baseurl}login/reset/{$user_id}/{$token}'>link</a> to set your account's password.
MARKUP;
            my_mail($email, "Set new password", $body);
        }
        return $data;
    }
开发者ID:cyberhck,项目名称:kookoo,代码行数:28,代码来源:Account.php


示例5: my_die

function my_die($error = '')
{
    if (is_string($error)) {
        if (empty($error)) {
            $error = 'db_error';
        }
        $error .= ': ' . my_trace(debug_backtrace());
        $error .= "\r\n" . mysql_error();
    } elseif (is_object($error)) {
        $error = $error->getMessage() . ': ' . my_exeption_trace($error);
    }
    $subject = $_SERVER['HTTP_HOST'] . ' ' . 'error';
    $message = $error . "\r\n\r\n" . my_info();
    my_mail($message, $subject);
    if (defined('DEBUG') || defined('LOCALHOST')) {
        //		echo("<div style=\"padding: 20px; margin: 20px; border: 1px solid red;\"><pre>$error</pre></div>");
        include_once FLGR_COMMON . '/exit.php';
    } else {
        $die = "Произошла ошибка.<br />";
        $die .= "Администратору сайта выслан e-mail с ее описанием - <br />";
        $die .= "он постарается все исправить в самое ближайшее время.";
        echo $die;
        include_once FLGR_COMMON . '/exit.php';
    }
}
开发者ID:rigidus,项目名称:cobutilniki,代码行数:25,代码来源:common.php


示例6: emailNotification2ModsAndAdmins

/**
 * sends an e-mail notification to all admins and mods who have activated  
 * e-mail notification 
 * 
 * @param int $id : the id of the posting
 * @param bool $delayed : true adds a delayed message (when postibg was activated manually)   
 */
function emailNotification2ModsAndAdmins($id, $delayed = false)
{
    global $settings, $db_settings, $lang, $connid;
    $id = intval($id);
    // data of posting:
    $result = @mysql_query("SELECT pid, name, user_name, " . $db_settings['forum_table'] . ".user_id, subject, text \r\n                         FROM " . $db_settings['forum_table'] . " \r\n                         LEFT JOIN " . $db_settings['userdata_table'] . " ON " . $db_settings['userdata_table'] . ".user_id=" . $db_settings['forum_table'] . ".user_id\r\n                         WHERE id = " . intval($id) . " LIMIT 1", $connid);
    $data = mysql_fetch_array($result);
    mysql_free_result($result);
    // overwrite $data['name'] with $data['user_name'] if registered user:
    if ($data['user_id'] > 0) {
        if (!$data['user_name']) {
            $data['name'] = $lang['unknown_user'];
        } else {
            $data['name'] = $data['user_name'];
        }
    }
    $name = stripslashes($data['name']);
    $subject = stripslashes($data['subject']);
    $text = email_format(stripslashes($data['text']));
    if ($data['pid'] > 0) {
        $emailbody = str_replace("[name]", $name, $lang['admin_email_text_reply']);
    } else {
        $emailbody = str_replace("[name]", $name, $lang['admin_email_text']);
    }
    $emailbody = str_replace("[subject]", $subject, $emailbody);
    $emailbody = str_replace("[text]", $text, $emailbody);
    $emailbody = str_replace("[posting_address]", $settings['forum_address'] . "index.php?id=" . $id, $emailbody);
    $emailbody = str_replace("[forum_address]", $settings['forum_address'], $emailbody);
    if ($delayed == true) {
        $emailbody = $emailbody . "\n\n" . $lang['email_text_delayed_addition'];
    }
    $emailbody = stripslashes($emailbody);
    $lang['admin_email_subject'] = str_replace("[subject]", stripslashes($subject), $lang['admin_email_subject']);
    // who gets an E-mail notification?
    $recipient_result = @mysql_query("SELECT user_name, user_email FROM " . $db_settings['userdata_table'] . " WHERE user_type > 0 AND new_posting_notification=1", $connid) or raise_error('database_error', mysql_error());
    while ($admin_array = mysql_fetch_array($recipient_result)) {
        $ind_emailbody = str_replace("[admin]", $admin_array['user_name'], $emailbody);
        $recipient = my_mb_encode_mimeheader($admin_array['user_name'], CHARSET, "Q") . " <" . $admin_array['user_email'] . ">";
        my_mail($recipient, $lang['admin_email_subject'], $ind_emailbody);
    }
    mysql_free_result($recipient_result);
}
开发者ID:aunderwo,项目名称:sobc,代码行数:49,代码来源:functions.inc.php


示例7: captcha

        $captcha = new captcha();
        if ($captcha->validate_captcha() == false) {
            // CAPTCHA validation failed
            foreach ($captcha->get_errors() as $error) {
                $errors[] = $error;
            }
        }
    }
    if (count($errors) == 0) {
        if ($mybb->settings['mail_handler'] == 'smtp') {
            $from = $mybb->input['fromemail'];
        } else {
            $from = "{$mybb->input['fromname']} <{$mybb->input['fromemail']}>";
        }
        $message = $lang->sprintf($lang->email_emailuser, $to_user['username'], $mybb->input['fromname'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->get_input('message'));
        my_mail($to_user['email'], $mybb->get_input('subject'), $message, $from, "", "", false, "text", "", $mybb->input['fromemail']);
        if ($mybb->settings['mail_logging'] > 0) {
            // Log the message
            $log_entry = array("subject" => $db->escape_string($mybb->get_input('subject')), "message" => $db->escape_string($mybb->get_input('message')), "dateline" => TIME_NOW, "fromuid" => $mybb->user['uid'], "fromemail" => $db->escape_string($mybb->input['fromemail']), "touid" => $to_user['uid'], "toemail" => $db->escape_string($to_user['email']), "tid" => 0, "ipaddress" => $db->escape_binary($session->packedip), "type" => 1);
            $db->insert_query("maillogs", $log_entry);
        }
        $plugins->run_hooks("member_do_emailuser_end");
        redirect(get_profile_link($to_user['uid']), $lang->redirect_emailsent);
    } else {
        $mybb->input['action'] = "emailuser";
    }
}
if ($mybb->input['action'] == "emailuser") {
    $plugins->run_hooks("member_emailuser_start");
    // Guests or those without permission can't email other users
    if ($mybb->usergroup['cansendemail'] == 0) {
开发者ID:nicopinto,项目名称:fantasitura.com,代码行数:31,代码来源:member.php


示例8: array

 $updated_user['usergroup'] = $user['usergroup'];
 // Update
 if ($user['coppauser']) {
     $updated_user = array("coppauser" => 0);
 } else {
     $db->delete_query("awaitingactivation", "uid='{$user['uid']}'");
 }
 // Move out of awaiting activation if they're in it.
 if ($user['usergroup'] == 5) {
     $updated_user['usergroup'] = 2;
 }
 $plugins->run_hooks("admin_user_users_coppa_activate_commit");
 $db->update_query("users", $updated_user, "uid='{$user['uid']}'");
 $cache->update_awaitingactivation();
 $message = $lang->sprintf($lang->email_adminactivateaccount, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl']);
 my_mail($user['email'], $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']), $message);
 // Log admin action
 log_admin_action($user['uid'], $user['username']);
 if ($mybb->input['from'] == "home") {
     if ($user['coppauser']) {
         $message = $lang->success_coppa_activated;
     } else {
         $message = $lang->success_activated;
     }
     update_admin_session('flash_message2', array('message' => $message, 'type' => 'success'));
 } else {
     if ($user['coppauser']) {
         flash_message($lang->success_coppa_activated, 'success');
     } else {
         flash_message($lang->success_activated, 'success');
     }
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:users.php


示例9: array

     // nat
     $sql = $Db->sqlGetSelect(DB_PREFIX . DB_TBL_NAT, array('to')) . $Db->sqlGetWhere(array('from' => $sRequest));
     $sql = $Db->queryRow($sql);
     if (!empty($sql)) {
         // 301
         //		cStat::bSaveEvent(EVENT_301);
         $nat = current($sql);
         header('301 Moved Permanently');
         header('Location: ' . $nat);
         die("<h1>301 Moved Permanently</h1>" . '<a href="' . $nat . '">http://' . HOST . $nat . '</a>');
     } else {
         // 404
         header('HTTP/1.1 404 Not Found');
         $subject = $_SERVER['HTTP_HOST'] . ' ' . '404 Not Found';
         $message = my_info();
         my_mail($message, $subject);
         //		cStat::bSaveEvent(EVENT_404);
         die('404 Not Found');
     }
 }
 // Вывод
 header('Content-Type: text/html; charset=' . CHARSET);
 $sOut = $_t->get();
 if (defined('CACHE_ON')) {
     if ($bFlagCache) {
         $Cashe->Add($sRequest, $nLastId, $sOut);
     }
 }
 //echo preg_replace('/\s{2,}/', ' ', $_t->get());
 echo $sOut;
 if (defined('DEBUG')) {
开发者ID:rigidus,项目名称:cobutilniki,代码行数:31,代码来源:index.php


示例10: my_die

            my_die();
        }
        $aNotifyUsers = array();
        while ($row = mysql_fetch_assoc($sql)) {
            $aNotifyUsers[$row['id']] = $row;
        }
        $aEmailsUsers = array();
        foreach ($aNotifyUsers as $k => $v) {
            if ($v['not_notify'] == 0 && !empty($v['email']) && $v['email'] != $_SESSION['user']['email']) {
                $aEmailsUsers[] = $v['email'];
            }
        }
        $message = 'Пользователь ' . $_SESSION['user']['name'] . ' ответил на ваш комментарий в обсуждении на странице http://' . HOST . $sRequest;
        $subject = 'Ответ на ваш комментарий на сайте ' . HOST;
        foreach (array_flip($aEmailsUsers) as $k => $v) {
            my_mail($message, $subject, $k);
        }
    }
}
$sql = 'SELECT * FROM `' . DB_PREFIX . DB_TBL_POSTS . '` WHERE `id` = ' . $aRequest[$nLevel + 2];
$sql = mysql_query($sql);
if (false == $sql) {
    my_die();
}
$aPost = mysql_fetch_assoc($sql);
if (empty($aPost)) {
    // HEAD_TITLE
    $_t->assign('head_title', '');
    // ADD_BREADCRUMBS
    $BreadCrumbs->addBreadCrumbs($sKey, $sTitle);
    // BREADCRUMBS
开发者ID:rigidus,项目名称:izverg,代码行数:31,代码来源:postid.php


示例11: send_mail_queue

/**
 * Sends a specified amount of messages from the mail queue
 *
 * @param int The number of messages to send (Defaults to 10)
 */
function send_mail_queue($count = 10)
{
    global $db, $cache, $plugins;
    $plugins->run_hooks("send_mail_queue_start");
    // Check to see if the mail queue has messages needing to be sent
    $mailcache = $cache->read("mailqueue");
    if ($mailcache['queue_size'] > 0 && ($mailcache['locked'] == 0 || $mailcache['locked'] < TIME_NOW - 300)) {
        // Lock the queue so no other messages can be sent whilst these are (for popular boards)
        $cache->update_mailqueue(0, TIME_NOW);
        // Fetch emails for this page view - and send them
        $query = $db->simple_select("mailqueue", "*", "", array("order_by" => "mid", "order_dir" => "asc", "limit_start" => 0, "limit" => $count));
        while ($email = $db->fetch_array($query)) {
            // Delete the message from the queue
            $db->delete_query("mailqueue", "mid='{$email['mid']}'");
            if ($db->affected_rows() == 1) {
                my_mail($email['mailto'], $email['subject'], $email['message'], $email['mailfrom'], "", $email['headers'], true);
            }
        }
        // Update the mailqueue cache and remove the lock
        $cache->update_mailqueue(TIME_NOW, 0);
    }
    $plugins->run_hooks("send_mail_queue_end");
}
开发者ID:khanfusiion,项目名称:mybb,代码行数:28,代码来源:functions.php


示例12: str_replace

             } else {
                 $new_user_notif_txt = $lang['new_user_notif_txt'];
             }
             $new_user_notif_txt = str_replace("[name]", $data['user_name'], $new_user_notif_txt);
             $new_user_notif_txt = str_replace("[email]", $data['user_email'], $new_user_notif_txt);
             $new_user_notif_txt = str_replace("[user_link]", $settings['forum_address'] . "index.php?mode=user&show_user=" . $id, $new_user_notif_txt);
             $new_user_notif_txt = stripslashes($new_user_notif_txt);
             // who gets a notification?
             $admin_result = @mysql_query("SELECT user_name, user_email FROM " . $db_settings['userdata_table'] . " WHERE user_type>0 AND new_user_notification=1", $connid);
             if (!$admin_result) {
                 raise_error('database_error', mysql_error());
             }
             while ($admin_array = mysql_fetch_array($admin_result)) {
                 $ind_reg_emailbody = str_replace("[recipient]", $admin_array['user_name'], $new_user_notif_txt);
                 $admin_mailto = my_mb_encode_mimeheader($admin_array['user_name'], CHARSET, "Q") . " <" . $admin_array['user_email'] . ">";
                 my_mail($admin_mailto, $lang['new_user_notif_sj'], $ind_reg_emailbody);
             }
         }
         if ($settings['register_mode'] == 1) {
             header("Location: index.php?mode=login&login_message=account_activated_but_locked");
         } else {
             header("Location: index.php?mode=login&login_message=account_activated");
         }
         exit;
     } else {
         $error = true;
     }
 }
 if (isset($error)) {
     $smarty->assign('lang_section', 'register');
     $smarty->assign('message', 'activation_failed');
开发者ID:aunderwo,项目名称:sobc,代码行数:31,代码来源:register.inc.php


示例13: date

/*session_start();
	if (!empty($_POST['validator']) && $_POST['validator'] == $_SESSION['rand_code']) {
		//return false;*/
/////////////////////////////////////////
include "libs_mail.php";
$data_crt = date("Y-m-d H:i:s");
$from = "{$_POST['fio']}";
$headers = "From: {$from}";
$subject = "Вопрос от {$_POST['fio']}";
$msg = "Контактные данные\n\n";
$msg = $msg . "Имя - {$_POST['fio']}\n";
$msg = $msg . "Телефон - {$_POST['phone']}\n";
$msg = $msg . "E-mail - {$_POST['eml_user']}\n\n";
$msg = $msg . "Вопрос:\n {$_POST['text']}";
if ($_POST[fio] or $_POST[text] or $_POST[eml_user] or $_POST[phone]) {
    my_mail($headers, $subject, $msg, "[email protected]");
    //my_mail($headers, $subject, $msg, "[email protected]");
    //my_mail($headers, $subject, $msg, "[email protected]");
    Header("Location: faq_send.html");
    exit;
} else {
    Header("Location: faq_send.html");
    exit;
}
/*		unset($_SESSION['rand_code']);

/////////////////////////////////////////
	} elseif($_POST) {
//		return true;
		Header("Location: faq_send.html");
		exit;
开发者ID:vladletnabov,项目名称:pechati,代码行数:31,代码来源:send_faq.php


示例14: mysql_free_result

         }
         mysql_free_result($pwf_result);
     }
     if (empty($error)) {
         $pwf_code = random_string(32);
         $pwf_code_hash = generate_pw_hash($pwf_code);
         $update_result = mysql_query("UPDATE " . $db_settings['userdata_table'] . " SET last_login=last_login, registered=registered, pwf_code='" . mysql_real_escape_string($pwf_code_hash) . "' WHERE user_id = " . intval($field['user_id']) . " LIMIT 1", $connid);
         // send mail with activating link:
         $smarty->config_load($settings['language_file'], 'emails');
         $lang = $smarty->get_config_vars();
         $lang['pwf_activating_email_txt'] = str_replace("[name]", $field["user_name"], $lang['pwf_activating_email_txt']);
         $lang['pwf_activating_email_txt'] = str_replace("[forum_address]", $settings['forum_address'], $lang['pwf_activating_email_txt']);
         $lang['pwf_activating_email_txt'] = str_replace("[activating_link]", $settings['forum_address'] . basename($_SERVER['PHP_SELF']) . "?mode=login&activate=" . $field["user_id"] . "&code=" . $pwf_code, $lang['pwf_activating_email_txt']);
         $lang['pwf_activating_email_txt'] = stripslashes($lang['pwf_activating_email_txt']);
         $pwf_mailto = my_mb_encode_mimeheader($field["user_name"], CHARSET, "Q") . " <" . $field["user_email"] . ">";
         if (my_mail($pwf_mailto, $lang['pwf_activating_email_sj'], $lang['pwf_activating_email_txt'])) {
             header("location: index.php?mode=login&login_message=mail_sent");
             exit;
         } else {
             header("Location: index.php?mode=login&login_message=mail_error");
             exit;
         }
     }
     header("Location: index.php?mode=login&login_message=pwf_failed");
     exit;
     break;
 case "activate":
     if (isset($_GET['activate']) && trim($_GET['activate']) != "" && isset($_GET['code']) && trim($_GET['code']) != "") {
         $pwf_result = mysql_query("SELECT user_id, user_name, user_email, pwf_code FROM " . $db_settings['userdata_table'] . " WHERE user_id = '" . intval($_GET["activate"]) . "'", $connid);
         if (!$pwf_result) {
             raise_error('database_error', mysql_error());
开发者ID:aunderwo,项目名称:sobc,代码行数:31,代码来源:login.inc.php


示例15: my_mail

$checking_mail = my_mail($mail);
if ($checking_pass == true and $checking_nsm == true and $checking_mail == true) {
    echo "Вітаємо ви були зареєстровані на сайті!";
    $query = mysql_query("INSERT INTO users(login, mail, name, surname, password, position, type) VALUES ('{$login}', '{$mail}', '{$name}', '{$surname}', '{$l_password}', '{$position}', '{$type}' )");
}
?>
	</div>
	<div id="register_field_right">
		<?php 
if ($_POST['submit']) {
    if ($checking_pass == false or $checking_nsm == false or $checking_mail == false) {
        echo '<p id="register_error_title">Вииникли помилки при реєстрації</p>';
        echo '<p id="register_error">';
        $checking_pass = pass($l_password, $r_password);
        $checking_nsm = check_nsm($name, $surname, $login);
        $checking_mail = my_mail($mail);
        if ($checking_pass == false) {
            echo "Поля з паролем мають бути заповненні.<br>";
            echo "Пароль має містити щонайменше 6 символів.<br>";
            echo "Паролі не співпадають.<br>";
        }
        if ($checking_mail == false) {
            echo "Не правильно вказано E-mail.<br>";
        }
        echo '</p>';
    }
}
?>
	
	</div>
	</div>
开发者ID:Dikape,项目名称:course_work,代码行数:31,代码来源:register.php


示例16: save

    /**
     *	populate_database function is responsible for populating database
     *	with the table structure for the first time
     *
     *	populate_database grabs tables.sql file and executes the query.
     *	if there are any table creations, just add the sql to tables.sql
     *	and it'll execute at the beginning of the installation
     *
     *	@author Nishchal Gautam <[email protected]>
     *	@access public
     *	@return Array Array with two keys, status (ok or error) and message
     *	@since 0.1
     *	@version 0.1
     */
    public function save()
    {
        if (isset($_POST['email'], $_POST['password'], $_POST['repass'])) {
            $user_email = $_POST['email'];
            $password = $_POST['password'];
            $re_password = $_POST['repass'];
            $this->load->helper('email');
            $this->load->model('user');
            if (!valid_email($user_email)) {
                $data['status'] = "error";
                $data['message'] = "Please enter a valid email!";
            } else {
                if ($password != $re_password) {
                    $data['status'] = "error";
                    $data['message'] = "Password and Confirmation password mismatch";
                } elseif (strlen($password) < 6) {
                    $data['status'] = "error";
                    $data['message'] = "Password must be minimum of 6 characters";
                } elseif ($this->user->check_email($user_email)) {
                    $data['status'] = "error";
                    $data['message'] = "This email is already registered with us.";
                } else {
                    $data['status'] = "ok";
                    $data['message'] = "User Created, please check email for verification";
                    $query['email'] = $user_email;
                    $query['password'] = password_hash($password, PASSWORD_DEFAULT);
                    $query['name'] = $_POST['name'];
                    $query['user_type'] = SUPER_ADMIN;
                    $user_name = $_POST['name'];
                    $this->db->insert('users', $query);
                    $insert_id = $this->db->insert_id();
                    $token = md5(rand() . microtime() . rand()) . md5(time());
                    unset($query);
                    $query['verification_code'] = $token;
                    $query['user'] = $insert_id;
                    $query['status'] = '0';
                    $this->db->insert('email_verification', $query);
                    $baseurl = base_url();
                    $this->load->helper('mail_helper');
                    $body = <<<MARKUP
\t\t\t\t\tWelcome {$user_name}, please click on this <a href='{$baseurl}accounts/verify/{$insert_id}/{$token}'>link</a> to vefity your account.
MARKUP;
                    my_mail($user_email, "Welcome to " . APP_NAME . " | email verification.", $body);
                }
            }
            return $data;
        } else {
            show_404();
        }
    }
开发者ID:cyberhck,项目名称:kookoo,代码行数:64,代码来源:Installer.php


示例17: error

 $query = $db->simple_select("joinrequests", "*", "uid='" . $mybb->user['uid'] . "' AND gid='" . $mybb->get_input('joingroup', MyBB::INPUT_INT) . "'");
 $joinrequest = $db->fetch_array($query);
 if ($joinrequest['rid']) {
     error($lang->already_sent_join_request);
 }
 if ($mybb->get_input('do') == "joingroup" && $usergroup['type'] == 4) {
     $now = TIME_NOW;
     $joinrequest = array("uid" => $mybb->user['uid'], "gid" => $mybb->get_input('joingroup', MyBB::INPUT_INT), "reason" => $db->escape_string($mybb->get_input('reason')), "dateline" => TIME_NOW);
     $db->insert_query("joinrequests", $joinrequest);
     foreach ($groupleaders[$usergroup['gid']] as $leader) {
         // Load language
         $lang->set_language($leader['language']);
         $lang->load("messages");
         $subject = $lang->sprintf($lang->emailsubject_newjoinrequest, $mybb->settings['bbname']);
         $message = $lang->sprintf($lang->email_groupleader_joinrequest, $leader['username'], $mybb->user['username'], $usergroup['title'], $mybb->settings['bbname'], $mybb->get_input('reason'), $mybb->settings['bburl'], $leader['gid']);
         my_mail($leader['email'], $subject, $message);
     }
     // Load language
     $lang->set_language($mybb->user['language']);
     $lang->load("messages");
     $plugins->run_hooks("usercp_usergroups_join_group_request");
     redirect("usercp.php?action=usergroups", $lang->group_join_requestsent);
     exit;
 } elseif ($usergroup['type'] == 4) {
     $joingroup = $mybb->get_input('joingroup', MyBB::INPUT_INT);
     eval("\$joinpage = \"" . $templates->get("usercp_usergroups_joingroup") . "\";");
     output_page($joinpage);
     exit;
 } else {
     join_usergroup($mybb->user['uid'], $mybb->get_input('joingroup', MyBB::INPUT_INT));
     $plugins->run_hooks("usercp_usergroups_join_group");
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:usercp.php


示例18: str_replace

     }
 } else {
     $recipient_name = $settings['forum_name'];
     $recipient_email = $settings['forum_email'];
 }
 if (empty($errors)) {
     $smarty->config_load($settings['language_file'], 'emails');
     $lang = $smarty->get_config_vars();
     if (isset($_SESSION[$settings['session_prefix'] . 'user_name'])) {
         $emailbody = str_replace("[user]", stripslashes($_SESSION[$settings['session_prefix'] . 'user_name']), $lang['contact_email_txt_user']);
     } else {
         $emailbody = $lang['contact_email_txt'];
     }
     $emailbody = str_replace("[message]", stripslashes($text), $emailbody);
     $emailbody = str_replace("[forum_address]", $settings['forum_address'], $emailbody);
     if (!my_mail($recipient_email, $subject, $emailbody, $sender_email)) {
         $errors[] = 'error_mailserver';
     }
 }
 if (isset($errors)) {
     $_SESSION[$settings['session_prefix'] . 'formtime'] = $current_time - 7;
     // 7 seconds credit (form already sent)
     $smarty->assign('errors', $errors);
     if (isset($id)) {
         $smarty->assign('id', $id);
     }
     if (isset($user_id)) {
         $smarty->assign('recipient_user_id', $user_id);
     }
     if (isset($sender_email)) {
         $smarty->assign('sender_email', htmlspecialchars(stripslashes($sender_email)));
开发者ID:aunderwo,项目名称:sobc,代码行数:31,代码来源:contact.inc.php


示例19: login_attempt_check_acp

        }
        $loginattempts = login_attempt_check_acp($login_user['uid'], true);
        // Have we attempted too many times?
        if ($loginattempts['loginattempts'] > 0) {
            // Have we set an expiry yet?
            if ($loginattempts['loginlockoutexpiry'] == 0) {
                $db->update_query("adminoptions", array("loginlockoutexpiry" => TIME_NOW + intval($mybb->settings['loginattemptstimeout']) * 60), "uid='" . intval($login_user['uid']) . "'");
            }
            // Did we hit lockout for the first time? Send the unlock email to the administrator
            if ($loginattempts['loginattempts'] == $mybb->settings['maxloginattempts']) {
                $db->delete_query("awaitingactivation", "uid='" . intval($login_user['uid']) . "' AND type='l'");
                $lockout_array = array("uid" => $login_user['uid'], "dateline" => TIME_NOW, "code" => random_str(), "type" => "l");
                $db->insert_query("awaitingactivation", $lockout_array);
                $subject = $lang->sprintf($lang->locked_out_subject, $mybb->settings['bbname']);
                $message = $lang->sprintf($lang->locked_out_message, htmlspecialchars_uni($mybb->input['username']), $mybb->settings['bbname'], $mybb->settings['maxloginattempts'], $mybb->settings['bburl'], $mybb->config['admin_dir'], $lockout_array['code'], $lockout_array['uid']);
                my_mail($login_user['email'], $subject, $message);
            }
            $default_page->show_lockedout();
        }
        $fail_check = 1;
    }
} else {
    // No admin session - show message on the login screen
    if (!isset($mybb->cookies['adminsid'])) {
        $login_message = "";
    } else {
        $query = $db->simple_select("adminsessions", "*", "sid='" . $db->escape_string($mybb->cookies['adminsid']) . "'");
        $admin_session = $db->fetch_array($query);
        // No matching admin session found - show message on login screen
        if (!$admin_session['sid']) {
            $login_message = $lang->error_invalid_admin_session;
开发者ID:slothly,项目名称:mybb,代码行数:31,代码来源:index.php


示例20: array

        $user = array("uid" => $mybb->user['uid'], "email" => $mybb->input['email'], "email2" => $mybb->input['email2']);
        $userhandler->set_data($user);
        if (!$userhandler->validate_user()) {
            $errors = $userhandler->get_friendly_errors();
        } else {
            if ($mybb->user['usergroup'] != "5" && $mybb->usergroup['cancp'] != 1) {
                $activationcode = random_str();
                $now = TIME_NOW;
                $db->delete_query("awaitingactivation", "uid='" . $mybb->user['uid'] . "'");
                $newactivation = array("uid" => $mybb->user['uid'], "dateline" => TIME_NOW, "code" => $activationcode, "type" => "e", "oldgroup" => $mybb->user['usergroup'], "misc" => $db->escape_string($mybb->input['email']));
                $db->insert_query("awaitingactivation", $newactivation);
                $username = $mybb->user['username'];
                $uid = $mybb->user['uid'];
                $lang->emailsubject_changeemail = $lang->sprintf($lang->emailsubject_changeemail, $mybb->settings['bbname']);
                $lang->email_changeemail = $lang->sprintf($lang->email_changeemail, $mybb->user['username'], $mybb->settings['bbname'], $mybb->user['email'], $mybb->input['email'], $mybb->settings['bburl'], $activationcode 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP my_mysql_connect函数代码示例发布时间:2022-05-15
下一篇:
PHP my_log函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap