Хранилища Subversion kbase

Редакция

Редакция 24 | Редакция 29 | К новейшей редакции | Только различия | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS

Редакция 24 Редакция 27
1
<?php
1
<?php
2
2
3
/**
3
/**
4
 *  KBase  
4
 *  KBase  
5
 *  http://alex-w.org.ru/p/kbase/
5
 *  http://alex-w.org.ru/p/kbase/
6
 *
6
 *
7
 *  Copyright (c) 2009 Alexander Wolf
7
 *  Copyright (c) 2009 Alexander Wolf
8
 *  Dual licensed under the MIT and GNU LGPL licenses.
8
 *  Dual licensed under the MIT and GNU LGPL licenses.
9
 *  http://alex-w.org.ru/p/kbase/license
9
 *  http://alex-w.org.ru/p/kbase/license
10
 *
10
 *
11
 */
11
 */
12
12
13
class Theme {
13
class Theme {
14
14
15
        function showSigninForm() {
15
        function showSigninForm() {
16
                global $_SESSION;
-
 
17
                global $auth;
16
                global $auth;
18
17
19
                $ID = $auth->getUserID($_SESSION["sign"], $_SESSION["hash"]);
18
                $ID = $auth->getUserID($_COOKIE["sign"], $_COOKIE["hash"]);
20
                if ($ID===0) {
19
                if ($ID===0) {
21
                        $return  = "<div id='yousign'><a href='sign.php?action=signup'>"._("Signup")."</a>";
20
                        $return  = "<div id='yousign'><a href='sign.php?action=signup'>"._("Signup")."</a>";
22
                        $return .= "&bull; <form action='process.php' method='post'>";
21
                        $return .= "&bull; <form action='process.php' method='post'>";
23
                        $return .= "<input type='hidden' name='action' value='signin'>";
22
                        $return .= "<input type='hidden' name='action' value='signin'>";
24
                        $return .= _("E-mail:")." <input type='text' name='login'> ";
23
                        $return .= _("E-mail:")." <input type='text' name='login'> ";
25
                        $return .= _("Password:")." <input type='password' name='passwd'>";
24
                        $return .= _("Password:")." <input type='password' name='passwd'>";
26
                        $return .= "<input type='submit' value='"._("Enter")."'></form></div>";
25
                        $return .= "<input type='submit' value='"._("Enter")."'></form></div>";
27
                } else {
26
                } else {
28
                        $member = $auth->getUserInfo($ID);
27
                        $member = $auth->getUserInfo($ID);
29
                        $return  = "<div id='yousign'>".$member["RealName"]." [<a href='sign.php?action=exit'>"._("Exit")."</a>]</div>";
28
                        $return  = "<div id='yousign'>".$member["RealName"]." [<a href='sign.php?action=exit'>"._("Exit")."</a>]</div>";
30
                }
29
                }
31
                return $return;
30
                return $return;
32
        }
31
        }
33
32
34
        function showSignupForm() {
33
        function showSignupForm() {
35
                $return  = "<form action='process.php' method='post'>";
34
                $return  = "<form action='process.php' method='post'>";
36
                $return .= "<fieldset><input type='hidden' name='action' value='signup'>";
35
                $return .= "<fieldset><input type='hidden' name='action' value='signup'>";
37
                $return .= _("E-mail:")." <input type='text' name='login'><br>";
36
                $return .= _("E-mail:")." <input type='text' name='login'><br>";
38
                $return .= _("Password:")." <input type='password' name='passwd'><br>";
37
                $return .= _("Password:")." <input type='password' name='passwd'><br>";
39
                $return .= _("Password (again):")." <input type='password' name='passwdag'><br>";
38
                $return .= _("Password (again):")." <input type='password' name='passwdag'><br>";
40
                $return .= _("Real name:")." <input type='text' name='realname'><br>";
39
                $return .= _("Real name:")." <input type='text' name='realname'><br>";
41
                $return .= "<input type='submit' value='"._("Register")."'></fieldset></form>";
40
                $return .= "<input type='submit' value='"._("Register")."'></fieldset></form>";
42
41
43
                return $return;
42
                return $return;
44
        }
43
        }
45
}
44
}
46
45
47
?>
46
?>
48
 
47