当前位置: 首页>>代码示例>>PHP>>正文


PHP DBAccess::updateUser方法代码示例

本文整理汇总了PHP中DBAccess::updateUser方法的典型用法代码示例。如果您正苦于以下问题:PHP DBAccess::updateUser方法的具体用法?PHP DBAccess::updateUser怎么用?PHP DBAccess::updateUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBAccess的用法示例。


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

示例1: count

        }
        if (strlen($email) == 0) {
            $errorTextEmail = "Please specify your email address.";
            $errorStyleEmail = "background-color:#F99;";
            $error = true;
        } else {
            $result = DBAccess::getUserByEmail($userName);
            $rows = count($result, 0);
            if ($rows > 0 && $result[0]['UserID'] != $targetUserID) {
                $error = true;
                $errorTextEmail = "Email is already in use.";
                $errorStyleEmail = "background-color:#F99;";
            }
        }
        if (!$error) {
            DBAccess::updateUser($targetUserID, $userName, null, $lastName, $firstName, $email, $activated, $position);
            //echo "DBAccess::updateUser(" . $targetUserID. ", " .$userName. ", " .null . ", " . $lastName . ", " . $firstName . ", " . $email . ", " . $activated . ", " . $position . " );";
            //die();
            header("Location: ./userDetails.php?userID=" . $targetUserID);
        } else {
            //echo 'An error has been detected in your input';
        }
    } else {
        header("Location: ./index.php?e7");
    }
}
/**************************************************************************
 *
 * Pre form data
 *
 **************************************************************************/
开发者ID:astrix37,项目名称:seqas,代码行数:31,代码来源:editUser.php

示例2: elseif

    if (strlen($current) == 0) {
        $errorTextCurrent = "Please enter your current password";
        $errorStyleCurrent = "background-color:#F99;";
        $error = true;
    } elseif ($response <= 0) {
        $error = true;
        $errorTextCurrent = "Invalid Password";
        $errorStyleCurrent = "background-color:#F99;";
    }
    if (strlen($new) == 0) {
        $errorTextNew = "Please enter a new password";
        $errorStyleNew = "background-color:#F99;";
        $error = true;
    } else {
        if ($new != $confirm) {
            $error = true;
            $errorTextNew = "Passwords don't match";
            $errorStyleNew = "background-color:#F99;";
        }
    }
    if (!$error) {
        DBAccess::updateUser($userID, null, $new, null, null, null, null, null);
        header("Location: ./account.php");
    } else {
        //echo 'An error has been detected in your input';
    }
}
$title = "User Details";
$head = "";
$content = "\n\n\n\n<div class=\"container\" style=\"width:925px; float:right;\">\n<h1>Change Password</h1>\n<form name=\"passwordChange\" action=\"changePassword.php\" method=\"POST\">\n\n\n<!--Previous Password-->\n<label class=\"formLabel\">Current Password</label>\n<input class=\"formField\" type=\"password\" style=\"" . $errorStyleCurrent . "\" name=\"current\" id=\"current\" />\n<label class=\"error\" type=\"text\" name=\"errorCurrent\" id=\"errorCurrent\" >" . $errorTextCurrent . "</label>\n<br />\n\n<!--New Password-->\n<label class=\"formLabel\">NewPassword</label>\n<input class=\"formField\" type=\"password\" style=\"" . $errorStyleNew . "\"  name=\"new\" id=\"new\" />\n<label class=\"error\" name=\"errorNew\" id=\"errorNew\" >" . $errorTextNew . "</label>\n<br />\n\n<!--New Password Confirm-->\n<label class=\"formLabel\">Confirm Password</label>\n<input class=\"formField\"  type=\"password\" style=\"" . $errorStyleConfirm . "\" name=\"confirm\" id=\"confirm\" /><br />\n<label class=\"error\" name=\"errorConfirm\" id=\"errorConfirm\" >" . $errorTextConfirm . "</label>\n<br />\n\n\n<!--Submit-->\n<input type=\"hidden\" name=\"Submitted\" value=\"submitted\">\n<input class=\"formLabel\" type=\"submit\" value=\"Update!\" />\n<br /><br />\n</form>\n\n</div><!--End info div -->";
require "../template/userTemplate.php";
开发者ID:astrix37,项目名称:seqas,代码行数:31,代码来源:changePassword.php

示例3: chr

        //Generate random password
        $newPassword = "";
        for ($i = 0; $i < 8; $i++) {
            $newPassword .= chr(rand(97, 123));
        }
        $from = "noreply@seqas.org";
        $to = $email;
        $subject = "SEQAS: Reset Password";
        $body = "\n\t\t<!DOCTYPE html>\t\n\t\t<html>\n\t\t<head>\n\t\t<style>\n\t\t\n\t\tbody{\t\t\n\t\t\tcolor:#FFF;\n\t\t\tbackground-color:#000;\n\t\t\tmargin: 0px;\n\t\t\tpadding: 0px;\n\t\t\tfont-family: arial;\n\t\t}\n\t\t\n\t\t#header{\n\t\t\tfont-weight:bold;\n\t\t\tmargin-bottom:10px;\n\t\t\tcolor:#FF0;\n\t\t\ttext-decoration:none;\n\t\t}\n\t\t\n\t\t#header .text{\n\t\t\tvertical-align:middle;\n\t\t\ttext-align:center;\n\t\t\tfloat:right;\n\t\t\t\n\t\t\twidth:78%;\n\t\t\tpadding:1%;\n\t\t\tfont-size:20px;\n\t\t\t\n\t\t}\n\t\t\n\n\t\t#header .image{\n\t\t\twidth:20%;\n\t\t\tfloat:left;\n\t\t}\n\t\t\n\t\t#content{\n\t\t\tpadding:1px;\n\t\t\tmargin:1% 0%;\n\t\t\twidth:69%;\n\t\t\tfloat:right;\n\t\t}\n\t\t\n\t\t#wrapper{\n\t\t\twidth:100%;\n\t\t\theight:100%;\n\t\t\n\t\t\tmargin:auto;\n\t\t\tpadding: 10px 10px 10px 10px;\n\t\t\tborder-radius: 15px;\n\t\t\n\t\t}\n\t\t\n\t\t#footer{\n\t\t\tclear:both;\n\t\t\tborder-top:1px solid #FFF;\n\t\t\ttext-align:center;\n\t\t}\n \n \n \n\t\t\n\t\t</style>\n\t\t\n\t\t</head>\n\t\t<body>\n\t\t\n\t\t\n\t\t<div id=\"wrapper\">\n\t\t\t<a href=\"http://www.seqas.org\" style=\"text-decoration:none;\">\n\t\t\t<div id=\"header\">\n\t\t\t\t<div class=\"image\">\n\t\t\t\t\n\t\t\t\t<img src=\"http://www.seqas.org/Images/SEQAS-LG.jpg\"  alt=\"Home\" />\n\t\t\t\t</div>\n\t\t\t\t<div class=\"text\">\n\t\t\t\tSEQAS\n\t\t\t\tSouth East Queensland Astronomical Society\n\t\t\t\t</div >\n\t\t\t</div>\n\t\t\t</a>\n\t\t\t<div id=\"content\">\n\t\t\tHello " . $userDetails[0]['FirstName'] . ",<br />\n\t\t\tYour password has been reset.<br />\n\t\t\t\n\t\t\t<b>Username:</b> " . $userDetails[0]['LoginName'] . "<br />\n\t\t\t<b>Password:</b> " . $newPassword . "<br />\n\t\t\n\t\t\tRegards,<br />\n\t\t\tThe SEQAS team.\n\n\t\t\t</div>\n\t\t\t<div id=\"footer\">\n\t\t\t\tAny email regarding this site can be sent to webmaster@seqas.org<br />\n\t\t\n\t\t\t\t<br />\n\t\t\t\tLast Updated: Friday 29th November 2013<br />\n\t\t\t\tThis site is &copy; SEQAS 2013, All Rights Reserved.<br />\n\t\t\t\tWebsite designed by Thura<br />\n\t\t\t</div>\n\t\n\t\t</div>\n\t\t</body>\n\t\t\n\t\t</html>\n\t\t";
        $host = "ssl://canary.flexihostings.net";
        $port = "465";
        $username = "noreply@seqas.org";
        //<> give errors
        $password = "sPurntapp3n";
        $headers = array('From' => $from, 'To' => $to, 'Subject' => $subject, 'Reply-To' => 'noreply@seqas.org', 'MIME-Version' => '1.0\\n', 'Content-type' => 'text/html; charset=iso-8859-1\\n');
        $smtp = Mail::factory('smtp', array('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password));
        $result = DBAccess::updateUser($userDetails[0]['UserID'], null, $newPassword, null, null, null, null, null);
        $mail = $smtp->send($to, $headers, $body);
        if (PEAR::isError($mail)) {
            echo "<p>" . $mail->getMessage() . "</p>";
        } else {
            $feedBack = "PASSWORD RESET: CHECK YOUR EMAIL.";
        }
    } else {
        $feedBack = "An unknown error has occured";
    }
}
$title = "Forgot Password";
$head = "";
$content = "\n\n<div class=\"container\" style=\"width:600px; margin:auto;\">\n\n<form method=\"post\" class=\"signin\" action=\"/forgot-password/\" >\n\n\t<label class=\"error\" style=\"clear:left\" name=\"feedBack\" id=\"feedBack\" >" . $feedBack . "</label>\n\t\n\t<!--Email-->\n\t<label class=\"formLabel\">Email Address*</label>\n\t<input class=\"formField\" type=\"text\" style=\"" . $errorStyleEmail . "\"  name=\"email\" id=\"email\" placeholder=\"Email Address\" />\n\t<label class=\"formError\" name=\"errorUserName\" id=\"errorUserName\" >" . $errorTextEmail . "</label>\n\t\n\t<!--Submit-->\n\t<input type=\"hidden\" name=\"Submitted\" value=\"Submitted\">\n\t<input class=\"formLabel\" type=\"submit\" value=\"Reset\" />\n</form>\n\n<label class=\"formLabel\">* Required Field</label>\n\n<span style=\"clear: left; display: block;\"></span></div><!--End info div -->\n";
require $root . '/template/userTemplate.php';
开发者ID:astrix37,项目名称:seqas,代码行数:31,代码来源:forgotPassword.php


注:本文中的DBAccess::updateUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。