Beispiel #1
0
 public function __construct()
 {
     $this->Infos['Title'] = Language::Get('com.sbb.page.profile');
     // If logged in, redirect to start page
     if (!User::LoggedIn()) {
         header("Location: index.php");
     }
     $Message = '';
     if (isset($_POST['Submit'])) {
         if (User::CheckUpdate($_POST)) {
             User::Update(array('Homepage' => $_POST['Homepage'], 'Signatur' => $_POST['Signature']));
             $Message = Language::Get('com.sbb.profile.success');
         } else {
             $Message = '<b>' . Language::Get('com.sbb.error') . ':</b><ul><li>' . implode('</li><li>', Register::GetError()) . '</li></ul>';
         }
     }
     // Füllt die Variablen im TPL
     SBB::Template()->Assign(array('Homepage' => User::Get('Homepage'), 'Signature' => User::Get('Signatur'), 'Message' => $Message, 'Page' => 'Profile'));
 }
Beispiel #2
0
 public function __construct()
 {
     $this->Infos['Title'] = Language::Get('com.sbb.page.register');
     // If logged in, redirect to start page
     if (isset($_COOKIE['sbb_Token']) || Session::Read('UserID')) {
         header("Location: index.php");
     }
     $Message = '';
     if (isset($_POST['Register'])) {
         // Captcha doesn't work
         /*if($_POST['Captcha'] != $_SESSION['Captcha']) {
         			$message = '{lang=com.sbb.captcha.wrong}';
         		}
         		else*/
         if (Register::Check($_POST)) {
             User::Create($_POST['Username'], $_POST['Password'], $_POST['Email']);
             $Message = Language::Get('com.sbb.register.success');
         } else {
             $Message = '<b>' . Language::Get('com.sbb.error') . ':</b><ul><li>' . implode('</li><li>', Register::GetError()) . '</li></ul>';
         }
     }
     // Füllt die Variablen im TPL
     SBB::Template()->Assign(array('Message' => $Message, 'Page' => 'Register'));
 }