Subversion Repositories oidplus

Rev

Rev 279 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 279 Rev 281
Line 22... Line 22...
22
        public function action(&$handled) {
22
        public function action(&$handled) {
23
                if (isset($_POST["action"]) && ($_POST["action"] == "create_ra")) {
23
                if (isset($_POST["action"]) && ($_POST["action"] == "create_ra")) {
24
                        $handled = true;
24
                        $handled = true;
25
 
25
 
26
                        if (!OIDplus::authUtils()::isAdminLoggedIn()) {
26
                        if (!OIDplus::authUtils()::isAdminLoggedIn()) {
27
                                $out['icon'] = 'img/error_big.png';
-
 
28
                                $out['text'] = '<p>You need to <a '.OIDplus::gui()->link('oidplus:login').'>log in</a> as administrator.</p>';
27
                                throw new OIDplusException("You need to log in as administrator");
29
                                return $out;
-
 
30
                        }
28
                        }
31
 
29
 
32
                        $email = $_POST['email'];
30
                        $email = $_POST['email'];
33
                        $password1 = $_POST['password1'];
31
                        $password1 = $_POST['password1'];
34
                        $password2 = $_POST['password2'];
32
                        $password2 = $_POST['password2'];
Line 70... Line 68...
70
                        $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
68
                        $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? OIDplus::webpath(__DIR__).'icon_big.png' : '';
71
 
69
 
72
                        if (!OIDplus::authUtils()::isAdminLoggedIn()) {
70
                        if (!OIDplus::authUtils()::isAdminLoggedIn()) {
73
                                $out['icon'] = 'img/error_big.png';
71
                                $out['icon'] = 'img/error_big.png';
74
                                $out['text'] = '<p>You need to <a '.OIDplus::gui()->link('oidplus:login').'>log in</a> as administrator.</p>';
72
                                $out['text'] = '<p>You need to <a '.OIDplus::gui()->link('oidplus:login').'>log in</a> as administrator.</p>';
75
                                return $out;
73
                                return;
76
                        }
74
                        }
77
 
75
 
78
                        $out['text'] .= '<form id="adminCreateRaFrom" onsubmit="return adminCreateRaFormOnSubmit();">';
76
                        $out['text'] .= '<form id="adminCreateRaFrom" onsubmit="return adminCreateRaFormOnSubmit();">';
79
                        $out['text'] .= '<div><label class="padding_label">E-Mail:</label><input type="text" id="email" value=""></div>';
77
                        $out['text'] .= '<div><label class="padding_label">E-Mail:</label><input type="text" id="email" value=""></div>';
80
                        $out['text'] .= '<div><label class="padding_label">Password:</label><input type="password" id="password1" value=""/></div>';
78
                        $out['text'] .= '<div><label class="padding_label">Password:</label><input type="password" id="password1" value=""/></div>';
Line 82... Line 80...
82
                        $out['text'] .= '<br><input type="submit" value="Create"></form>';
80
                        $out['text'] .= '<br><input type="submit" value="Create"></form>';
83
                }
81
                }
84
        }
82
        }
85
 
83
 
86
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
84
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
-
 
85
                if (!OIDplus::authUtils()::isAdminLoggedIn()) return false;
-
 
86
               
87
                if (file_exists(__DIR__.'/treeicon.png')) {
87
                if (file_exists(__DIR__.'/treeicon.png')) {
88
                        $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png';
88
                        $tree_icon = OIDplus::webpath(__DIR__).'treeicon.png';
89
                } else {
89
                } else {
90
                        $tree_icon = null; // default icon (folder)
90
                        $tree_icon = null; // default icon (folder)
91
                }
91
                }