Esempio n. 1
0
             } else {
                 $success = 1;
             }
         }
     }
     $sm = sminit("register.tpl", null, "profiles", false, false);
     $sm->assign("success", $success);
     $sm->assign("errorstring", $errorstring);
     $sm->assign("regpolicy", THprofile_regpolicy);
     $sm->assign("emailwelcome", THprofile_emailwelcome);
     // Set the username for the Smarty template if we succeeded
     if ($success == 1) {
         $sm->assign("username", $username);
         // Send an email if the registration is immediately valid
         if (THprofile_regpolicy == 2 && THprofile_emailwelcome) {
             sendWelcome($username, $email);
         }
     }
     $sm->display("register.tpl", null);
 } else {
     if ($_GET['action'] == "forgotpass") {
         if (isset($_SESSION['username'])) {
             renderError("But you are logged in!");
         }
         $sm = sminit("forgotpass.tpl", null, "profiles", false, false);
         if (isset($_POST['user'])) {
             // Let Smarty know we're submitting
             $sm->assign("submitting", 1);
             if (THprofile_lcnames) {
                 $username = strtolower($_POST['user']);
             } else {
Esempio n. 2
0
     $sm->assign("filters", $filters);
     $sm->display("adminfilters.tpl");
 } elseif ($_GET['a'] == "p") {
     if (THdbtype == null) {
         THdie("ADdbfirst");
     }
     // Use the functions provided to us by this class
     $profile_dbi = new ThornProfileDBI();
     //move this over to t=p eventually - tyam
     if (isset($_GET['action']) && $_GET['action'] == "regyes" && isset($_GET['username'])) {
         // Approving an account
         // Use the approvalaction function
         $profile_dbi->approvalaction($_GET['username'], "account", true);
         if (THprofile_emailwelcome) {
             $email = $profile_dbi->getemail($_GET['username']);
             sendWelcome($_GET['username'], $email);
         }
     }
     if (isset($_GET['action']) && $_GET['action'] == "regno" && isset($_GET['username'])) {
         // Denying an account
         // Use the approvalaction function
         $profile_dbi->approvalaction($_GET['username'], "account", false);
         if (THprofile_emailwelcome) {
             $email = $profile_dbi->getemail($_GET['username']);
             sendDenial($_GET['username'], $email);
         }
     }
     if (isset($_GET['action']) && $_GET['action'] == "capyes" && isset($_GET['username'])) {
         // Approve a proposed capcode
         // This abstracts the rest of the DB queries for us
         $profile_dbi->approvalaction($_GET['username'], "capcode", true);