示例#1
0
    $result = getUserInfoByEmail($_POST["email"]);
    if ($result->oneid != "") {
        // if usr exist then reset password and inform via e-mail
        // gen salt and reset password in database then reset password in Cloud Infra
        $salt = substr(sha1(time()), 0, 10);
        $obone->UserPasswd($result->oneid, $salt);
        $obone_user = new Users();
        $obone_user->Load("oneid=" . $result->oneid);
        $obone_user->password = sha1($salt);
        $obone_user->Save();
        // send mail
        $body = file_get_contents("module/lostpassword/mail.lostpassword.txt");
        $body = ereg_replace("%NAME%", $result->name, $body);
        $body = ereg_replace("%SALT%", $salt, $body);
        $body = nl2br($body);
        sendMassMail("ONE Console reset password", $body, $result->name, $result->email);
        $msgerror = "Your new password was sent to your e-mail address!";
    } else {
        $msgerror = "Your e-mail address is not exist!";
    }
    ?>
<div class="login-container">
<h1 id="signup-logo"><a>One Console</a></h1>
<table class="round" width="490">
<tr>
	<td colspan="2"><?php 
    if (isset($msgerror)) {
        echo $msgerror;
    }
    ?>
</td>
示例#2
0
        $index = 1;
        foreach ($pvalue as $value) {
            $obone_userpriv = new User_Privileges();
            $obone_userpriv->user = $_POST["username"];
            $obone_userpriv->id = $index;
            $obone_userpriv->value = $value;
            $obone_userpriv->Save();
            $index++;
        }
        // send mail
        $body = file_get_contents("module/signup/mail.signup.txt");
        $body = ereg_replace("%NAME%", $_POST["name"], $body);
        $body = ereg_replace("%EMAIL%", $_POST["email"], $body);
        $body = ereg_replace("%URL%", $url, $body);
        $body = nl2br($body);
        sendMassMail("ONE Console registration confirm", $body, $_POST["name"], $_POST["email"]);
        // success message
        $msgerror = "Register account complete!, please check your e-mail to activate account.";
    } else {
        // error message
        $msgerror = "Cannot register account , please contact cloud administrator.";
    }
    ?>
<div class="login-container">
<h1 id="signup-logo"><a>One Console</a></h1>
<table class="round" width="490">
<tr>
	<td colspan="2"><?php 
    if (isset($msgerror)) {
        echo $msgerror;
    }