Ejemplo n.º 1
0
 function ActivationMail($Email, $UserID, $Username)
 {
     $ActivationToken = jf::$Security->RandomToken();
     jf::SaveGeneralSetting("activation_{$ActivationToken}", $UserID);
     $MyEmail = "admin@" . HttpRequest::Host();
     $Content = "Thank you for joininig " . constant("jf_Application_Title") . " {$Username},\n\t\t\t\tPlease open the following link in order to activate your account:\n\n\t\t\t\t" . SiteRoot . "/sys/xuser/signup?validate={$ActivationToken}\n\n\t\t\t\tIf you did not sign up on this site, just ignore this email.";
     return mail($Email, "Account Confirmation", $Content, "From: " . constant("jf_Application_Name") . " <{$MyEmail}>");
 }
Ejemplo n.º 2
0
 function Insert()
 {
     if (jf::$RunMode->IsCLI()) {
         return false;
     }
     $res = jf::SQL("INSERT INTO {$this->TablePrefix()}stats (UserID,SessionID,Timestamp,Page,Query,IP,Host,Protocol,UserAgent) VALUES\n\t\t\t(?,?,?,?,?,?,?,?,?)", jf::CurrentUser() ?: 0, jf::$Session->SessionID(), jf::time(), HttpRequest::URI(), HttpRequest::QueryString(), HttpRequest::IP(), HttpRequest::Host(), HttpRequest::Protocol(), HttpRequest::UserAgent());
     return $res;
 }
Ejemplo n.º 3
0
 function ResetMail($Email, $UserID)
 {
     $Temp = jf::$XUser->TemporaryResetPassword($UserID);
     $MyEmail = "admin@" . HttpRequest::Host();
     $UserInfo = jf::$XUser->UserInfo($UserID);
     $Content = "You have requested to reset the password for username '{$UserInfo['Username']}',\n\t\t\t\tPlease open the following link in order to reset your password:\n\t\t\t\t\n\t\t\t\t" . SiteRoot . "/sys/xuser/reset?user={$UserID}&temp={$Temp}\n\t\t\n\t\t\t\tThe above link is valid for one hour only.\n\t\t\t\tIf you did not ask your password to be reset, just ignore this email.\n";
     // 		echo $Content;
     return mail($Email, "Account Password Recovery", $Content, "From: " . constant("jf_Application_Name") . " <{$MyEmail}>");
 }
Ejemplo n.º 4
0
 *
 * Define your jframework powered web application here. Set at least a version, a Name and a
 * title for your application. Name would better follow identifier rules.
 */
const jf_Application_Version = "1.0";
//put version of your application here, as a string.
const jf_Application_Name = "WebGoatPHP";
//follow identifier rules for this name
const jf_Application_Title = "OWASP WebGoatPHP";
//title of your application
/**
 * Mode detection
 * here jframework tries to determine what mode its running at,
 * Deploy, Develop or Command Line. Provide necessary logic for it to determine correctly
 */
if (strpos(HttpRequest::Host(), "LOCALHOSTURL") !== false) {
    jf::$RunMode->Add(RunModes::Develop);
} elseif (php_sapi_name() == "cli") {
    jf::$RunMode->Add(RunModes::CLI);
} else {
    jf::$RunMode->Add(RunModes::Deploy);
}
/**
 * Siteroot
 *
 * jframework requires to know where your site root is, e.g http://jframework.info
 * or http://tld.com/myfolder/myjf/deploy
 * automatically determines this, so change it and define it manually only when necessary
 * you can use this constant in your views for absolute urls
 */
define("SiteRoot", HttpRequest::Root());