function main($itsp)
 {
     include_once "dwoo/dwooAutoload.php";
     $displayNewUserForm = 1;
     $emailsent = "";
     $reset = $itsp->bUrl->getGP("s");
     $username = $itsp->bUrl->getGP("u");
     $showform = 1;
     $errormsg = "";
     if ($_POST["reset"]) {
         include_once "user_backend.php";
         $user = new user_backend("reset");
         if ($user->setNewPassword($_POST["reset"], $_POST["password"])) {
             $showform = 0;
             $tpl = new Dwoo_Template_File('templates/setnewpassword1.tpl');
             $dwoo = new Dwoo();
             $markerArray = templateArray();
             $output = $dwoo->get($tpl, $markerArray);
             print $output;
             exit;
         } else {
             $errormsg = "Please enter a valid password";
         }
     }
     if ($reset != "" && $username != "" && $showform) {
         $tpl = new Dwoo_Template_File('templates/setnewpassword.tpl');
         $dwoo = new Dwoo();
         $markerArray = templateArray();
         $markerArray["url"] = $_SERVER["REQUEST_URI"];
         $markerArray["reset"] = $reset;
         $markerArray["errormsg"] = $errormsg;
         $output = $dwoo->get($tpl, $markerArray);
         print $output;
     }
 }
Beispiel #2
0
 function main($itsp)
 {
     $itsp->bLang->setLanguage($_GET["lang"]);
     include_once "dwoo/dwooAutoload.php";
     $params = array();
     $params["lang"] = "dk";
     $params["screen"] = "newUser";
     $newUserUrl = $itsp->bUrl->newUrl("newuser", $params, 0, 0);
     $params = array();
     $screenshoturl = $itsp->bUrl->newUrl("screenshots", $params, 0, 0);
     $params = array();
     $loginUrl = $itsp->bUrl->newUrl("home", $params);
     $tpl = new Dwoo_Template_File('templates/frontpage.tpl');
     $dwoo = new Dwoo();
     $jsfiles = array();
     $jsfiles[] = array('jsfile' => 'js/newuser.js');
     $markerArray = templateArray();
     $markerArray["headertitle"] = $itsp->bLang->getLL("title") . " frontpage";
     $markerArray["username"] = $itsp->bLang->getLL("username");
     $markerArray["password"] = $itsp->bLang->getLL("password");
     $markerArray["title"] = "myTasks frontpage";
     $markerArray["loginbtn"] = "Login";
     $markerArray["createNewUser"] = $itsp->bLang->getLL("createNewUser");
     $markerArray["url"] = $newUserUrl;
     $markerArray["loginUrl"] = $loginUrl;
     $markerArray["js_list"] = $jsfiles;
     $markerArray["screenshoturl"] = $screenshoturl;
     $output = $dwoo->get($tpl, $markerArray);
     print $output;
 }
 function main($itsp)
 {
     include "dwoo/dwooAutoload.php";
     $tpl = new Dwoo_Template_File('templates/screenshots.tpl');
     $dwoo = new Dwoo();
     $markerArray = templateArray();
     $markerArray["title"] = "screenshots";
     $output = $dwoo->get($tpl, $markerArray);
     print $output;
 }
Beispiel #4
0
 function main($itsp)
 {
     include "dwoo/dwooAutoload.php";
     $tpl = new Dwoo_Template_File('templates/error.tpl');
     $dwoo = new Dwoo();
     $markerArray = templateArray();
     $markerArray["title"] = $itsp->bLang->getLL("page.error.title");
     $markerArray["pagenotfound"] = $itsp->bLang->getLL("page.error.pagenotfound");
     $markerArray["goback"] = $itsp->bLang->getLL("page.error.goback");
     $output = $dwoo->get($tpl, $markerArray);
     print $output;
 }
 function main($itsp)
 {
     include "dwoo/dwooAutoload.php";
     $displayNewUserForm = 1;
     $emailsent = "";
     if ($_POST["username"]) {
         include_once "user_backend.php";
         $bUser = new user_backend("newuser");
         $sess = $bUser->resetPassword($_POST["username"]);
         if ($sess) {
             $tpl = new Dwoo_Template_File('templates/forgotpasswordemail.tpl');
             $dwoo = new Dwoo();
             $params = array();
             $params["s"] = $sess["reset"];
             $params["u"] = $sess["username"];
             $setnewpasswordUrl = $itsp->bUrl->newUrl("setnewpassword", $params, 1);
             $markerArray = array();
             $markerArray["emailForgotpasswordHello"] = $itsp->bLang->getLL("email.forgotpassword.hello");
             $markerArray["username"] = $sess["username"];
             $markerArray["emailForgotpasswordHostname"] = config::hostname;
             $markerArray["emailForgotpasswordMsg1"] = $itsp->bLang->getLL("email.forgotpassword.msg1");
             $markerArray["emailForgotpasswordMsg2"] = $itsp->bLang->getLL("email.forgotpassword.msg2");
             $markerArray["emailForgotpasswordMsg3"] = $itsp->bLang->getLL("email.forgotpassword.msg3");
             $markerArray["emailForgotpasswordMsg4"] = $itsp->bLang->getLL("email.forgotpassword.msg4");
             $markerArray["emailForgotpasswordMsg5"] = $itsp->bLang->getLL("email.forgotpassword.msg5");
             $markerArray["emailForgotpasswordMsg6"] = $itsp->bLang->getLL("email.forgotpassword.msg6");
             $markerArray["emailForgotpasswordURL"] = $setnewpasswordUrl;
             $markerArray["emailForgotpasswordSignature"] = $itsp->bLang->getLL("email.forgotpassword.signature");
             $forgotemail = $dwoo->get($tpl, $markerArray);
             $emailto = $sess["email"];
             $emailsubject = $itsp->bLang->getLL("email.forgotpassword.subject");
             $emailheaders = "From: " . config::resetpasswordFromEmail . "\r\n";
             mail($emailto, $emailsubject, $forgotemail, $emailheaders);
             $emailsent = "Email sent";
         }
     }
     if ($displayNewUserForm) {
         $tpl = new Dwoo_Template_File('templates/forgotpassword.tpl');
         $dwoo = new Dwoo();
         $markerArray = templateArray();
         $markerArray["url"] = $_SERVER["REQUEST_URI"];
         $markerArray["username"] = $itsp->bLang->getLL("username");
         $markerArray["password"] = $itsp->bLang->getLL("password");
         $markerArray["headertitle"] = $itsp->bLang->getLL("page.forgotpassword.title");
         $markerArray["loginbtn"] = $itsp->bLang->getLL("login");
         $markerArray["sendit"] = $itsp->bLang->getLL("sendit");
         $markerArray["emailsent"] = $emailsent;
         $createnewuser = $dwoo->get($tpl, $markerArray);
         print $createnewuser;
     }
 }
Beispiel #6
0
 function main($itsp)
 {
     include "dwoo/dwooAutoload.php";
     if ($itsp->bUrl->getGP("s")) {
         user_backend::verifyUser($itsp->bUrl->getGP("s"), $itsp->bUrl->getGP("u"), 9);
         $tpl = new Dwoo_Template_File('templates/rejectuser.tpl');
         $dwoo = new Dwoo();
         $markerArray = templateArray();
         $markerArray["pageRejectedMsg1"] = $itsp->bLang->getLL("page.rejecteduser.msg1");
         $output = $dwoo->get($tpl, $markerArray);
         print $output;
     } else {
         print "access denied";
     }
 }
Beispiel #7
0
 function main($itsp)
 {
     $itsp->bLang->setLanguage($_GET["lang"]);
     include_once "dwoo/dwooAutoload.php";
     $valid = isValidUser();
     if ($valid) {
         $tpl = new Dwoo_Template_File('templates/home.tpl');
         $dwoo = new Dwoo();
         $markerArray = loggedInArray();
         $output = $dwoo->get($tpl, $markerArray);
         print $output;
     } else {
         $tpl = new Dwoo_Template_File('templates/frontpage.tpl');
         $dwoo = new Dwoo();
         $markerArray = templateArray();
         $markerArray["loginerror"] = "Failed to login";
         $output = $dwoo->get($tpl, $markerArray);
         print $output;
     }
 }
Beispiel #8
0
 function main($itsp)
 {
     $itsp->bLang->setLanguage($_GET["lang"]);
     include "dwoo/dwooAutoload.php";
     $displayNewUserForm = 1;
     $errormsg = "";
     if ($_POST["username"] && $_POST["password"]) {
         include_once "user_backend.php";
         $bUser = new user_backend("newuser");
         try {
             $errormsg = "";
             $errors = 0;
             $passwordok = 0;
             if ($_POST["username"]) {
                 include_once "user_backend.php";
                 if (!$bUser->isUsernameAvail($_POST["username"])) {
                     if ($errormsg != "") {
                         $errormsg .= "<br />";
                     }
                     $errormsg .= $itsp->bLang->getLL("page.myinfo.usernamenotavailable");
                     $errors++;
                 }
             }
             if ($_POST["password"] != $_POST["repeatpassword"]) {
                 if ($errormsg != "") {
                     $errormsg .= "<br />";
                 }
                 $errormsg .= $itsp->bLang->getLL("page.myinfo.notidenticalpasswords");
                 $errors++;
             } else {
                 if ($_POST["password"] != "itsplanned") {
                     $passwordok = 1;
                 }
             }
             if (!preg_match('/^[^@]+@[a-zA-Z0-9._-]+\\.[a-zA-Z]+$/', $_POST["email"])) {
                 if ($errormsg != "") {
                     $errormsg .= "<br />";
                 }
                 $errormsg .= $itsp->bLang->getLL("page.myinfo.novalidemail");
                 $errors++;
             }
             if ($errors == 0) {
                 $bUser->createNew($_POST["username"], $_POST["password"]);
                 isValidUser("create");
                 $bUser->setUserInfo("realname", $_POST["realname"]);
                 $bUser->setUserInfo("email", $_POST["email"]);
                 $bUser->setUserInfo("verified", '0');
                 $tpl = new Dwoo_Template_File('templates/newuseremail.tpl');
                 $dwoo = new Dwoo();
                 $params = array();
                 $params["s"] = session_id();
                 $params["u"] = $_POST["username"];
                 $verifyuserUrl = $itsp->bUrl->newUrl("verifyuser", $params, 1);
                 $rejectuserUrl = $itsp->bUrl->newUrl("rejectuser", $params, 1);
                 $markerArray = array();
                 $markerArray["emailNewuserHello"] = $itsp->bLang->getLL("email.newuser.hello");
                 $markerArray["username"] = $_POST["username"];
                 $markerArray["emailNewuserHostname"] = config::hostname;
                 $markerArray["emailNewuserMsg1"] = $itsp->bLang->getLL("email.newuser.msg1");
                 $markerArray["emailNewuserMsg2"] = $itsp->bLang->getLL("email.newuser.msg2");
                 $markerArray["emailNewuserMsg3"] = $itsp->bLang->getLL("email.newuser.msg3");
                 $markerArray["emailNewuserMsg4"] = $itsp->bLang->getLL("email.newuser.msg4");
                 $markerArray["emailNewuserMsg5"] = $itsp->bLang->getLL("email.newuser.msg5");
                 $markerArray["emailNewuserMsg6"] = $itsp->bLang->getLL("email.newuser.msg6");
                 $markerArray["emailNewuserVerifyURL"] = $verifyuserUrl;
                 $markerArray["emailNewuserRejectURL"] = $rejectuserUrl;
                 $markerArray["emailNewuserSignature"] = $itsp->bLang->getLL("email.newuser.signature");
                 $newuseremail = $dwoo->get($tpl, $markerArray);
                 $emailto = $_POST["email"];
                 $emailsubject = $itsp->bLang->getLL("email.newuser.subject");
                 $emailheaders = "From: " . config::newuserFromEmail . "\r\n";
                 mail($emailto, $emailsubject, $newuseremail, $emailheaders);
                 $tpl = new Dwoo_Template_File('templates/userverification.tpl');
                 $dwoo = new Dwoo();
                 $markerArray = templateArray();
                 $markerArray["pageUserverificationMsg1"] = $itsp->bLang->getLL("page.userverification.msg1");
                 $output = $dwoo->get($tpl, $markerArray);
                 print $output;
                 exit;
             }
         } catch (Exception $e) {
             if ($e->getMessage() == "UserExist") {
                 $errormsg = "Username is already taken";
             }
         }
     }
     if ($displayNewUserForm) {
         $tpl = new Dwoo_Template_File('templates/myinfonew.tpl');
         $dwoo = new Dwoo();
         $markerArray = templateArray();
         $markerArray["url"] = $_SERVER["REQUEST_URI"];
         $markerArray["pageMyinfoErrorMsg"] = $errormsg;
         $markerArray["username"] = $itsp->bLang->getLL("username");
         $markerArray["password"] = $itsp->bLang->getLL("password");
         $markerArray["pageMyinfoUsername"] = $itsp->bLang->getLL("page.myinfo.username");
         $markerArray["pageMyinfoNewPassword"] = $itsp->bLang->getLL("page.myinfo.newpassword");
         $markerArray["pageMyinfoNewPasswordRepeat"] = $itsp->bLang->getLL("page.myinfo.newpasswordrepeat");
         $markerArray["pageMyinfoRealname"] = $itsp->bLang->getLL("page.myinfo.realname");
         $markerArray["pageMyinfoEmail"] = $itsp->bLang->getLL("page.myinfo.email");
         $markerArray["pageMyinfoUpdate"] = $itsp->bLang->getLL("page.myinfo.create");
         $markerArray["pageMyinfoLayoutLanguage"] = $itsp->bLang->getLL("page.myinfo.layoutlanguage");
         $markerArray["usernamefield"] = $_POST["username"];
         $markerArray["email"] = $_POST["email"];
         $markerArray["realname"] = $_POST["realname"];
         $markerArray["headertitle"] = $itsp->bLang->getLL("page.myinfo.newusertitle");
         $markerArray["loginbtn"] = $itsp->bLang->getLL("login");
         $createnewuser = $dwoo->get($tpl, $markerArray);
         print $createnewuser;
     }
 }