Хранилища Subversion kbase

Редакция

Редакция 27 | Редакция 30 | К новейшей редакции | Авторство | Сравнить с предыдущей | Последнее изменение | Открыть журнал | Скачать | RSS

<?php

/**
 *  KBase  
 *  http://alex-w.org.ru/p/kbase/
 *
 *  Copyright (c) 2009 Alexander Wolf
 *  Dual licensed under the MIT and GNU LGPL licenses.
 *  http://alex-w.org.ru/p/kbase/license
 *
 */


class Theme {

        function showSigninForm() {
                global $auth;
                global $cookie;

                $ID = $auth->getUserID($_COOKIE[$cookie["sing"]], $_COOKIE[$cookie["hash"]]);
                if ($ID===0) {
                        $return  = "<div id='yousign'><a href='sign.php?action=signup'>"._("Signup")."</a>";
                        $return .= "&bull; <form action='process.php' method='post'>";
                        $return .= "<input type='hidden' name='action' value='signin'>";
                        $return .= _("E-mail:")." <input type='text' name='login'> ";
                        $return .= _("Password:")." <input type='password' name='passwd'>";
                        $return .= "<input type='submit' value='"._("Enter")."'></form></div>";
                } else {
                        $member = $auth->getUserInfo($ID);
                        $return  = "<div id='yousign'>".$member["RealName"]." [<a href='sign.php?action=exit'>"._("Exit")."</a>]</div>";
                }
                return $return;
        }

        function showSignupForm() {
                $return  = "<form action='process.php' method='post'>";
                $return .= "<fieldset><input type='hidden' name='action' value='signup'>";
                $return .= _("E-mail:")." <input type='text' name='login'><br>";
                $return .= _("Password:")." <input type='password' name='passwd'><br>";
                $return .= _("Password (again):")." <input type='password' name='passwdag'><br>";
                $return .= _("Real name:")." <input type='text' name='realname'><br>";
                $return .= "<input type='submit' value='"._("Register")."'></fieldset></form>";

                return $return;
        }
}

?>