Skip to content

Commit 649d639

Browse files
author
redray
committed
fixed form problems ... http://www.sprawsm.com/uni-form/
1 parent 62ff29c commit 649d639

File tree

138 files changed

+5794
-5376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+5794
-5376
lines changed

interface/lib/app.inc.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,19 @@ public function error($msg, $next_link = '', $stop = true, $priority = 1)
120120
<head>
121121
<title>Error</title>
122122
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
123-
<link href="../themes/default/style.css" rel="stylesheet" type="text/css" />
123+
<link href="../themes/default/css/central.css" rel="stylesheet" type="text/css" />
124124
</head>
125125
<body>
126-
<br /><br /><br />
127-
<table width="100%" border="0" cellspacing="0" cellpadding="2">
128-
<tr>
129-
<td class="error"><b>Error:</b><br />'.$msg;
130-
if($next_link != '') $msg .= '<a href="'.$next_link.'">Next</a><br />';
131-
$msg .= '</td>
132-
</tr>
133-
</table>
126+
<div class="uniForm">
127+
<div id="errorMsg">
128+
<h3>Error</h3>
129+
<ol>
130+
<li>'.$msg;
131+
if($next_link != '') $msg .= '<a href="'.$next_link.'">Next</a>';
132+
$msg .= '</li>
133+
</ol>
134+
</div>
135+
</div>
134136
</body>
135137
</html>';
136138
die($msg);

interface/lib/classes/auth.inc.php

Lines changed: 105 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,106 @@
1-
<?php
2-
3-
/*
4-
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
5-
All rights reserved.
6-
7-
Redistribution and use in source and binary forms, with or without modification,
8-
are permitted provided that the following conditions are met:
9-
10-
* Redistributions of source code must retain the above copyright notice,
11-
this list of conditions and the following disclaimer.
12-
* Redistributions in binary form must reproduce the above copyright notice,
13-
this list of conditions and the following disclaimer in the documentation
14-
and/or other materials provided with the distribution.
15-
* Neither the name of ISPConfig nor the names of its contributors
16-
may be used to endorse or promote products derived from this software without
17-
specific prior written permission.
18-
19-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22-
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23-
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24-
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26-
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28-
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29-
*/
30-
31-
class auth {
32-
33-
public function is_admin() {
34-
if($_SESSION['s']['user']['typ'] == 'admin') {
35-
return true;
36-
} else {
37-
return false;
38-
}
39-
}
40-
41-
public function has_clients($userid) {
42-
global $app, $conf;
43-
44-
$userid = intval($userid);
45-
$client = $app->db->queryOneRecord("SELECT client.limit_client FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id");
46-
if($client['limit_client'] > 0) {
47-
return true;
48-
} else {
49-
return false;
50-
}
51-
}
52-
53-
//** This function adds a given group id to a given user.
54-
public function add_group_to_user($userid,$groupid) {
55-
global $app;
56-
57-
$userid = intval($userid);
58-
$groupid = intval($groupid);
59-
60-
if($userid > 0 && $groupid > 0) {
61-
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid");
62-
$groups = explode(',',$user['groups']);
63-
if(!in_array($groupid,$groups)) $groups[] = $groupid;
64-
$groups_string = implode(',',$groups);
65-
$sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid";
66-
$app->db->query($sql);
67-
return true;
68-
} else {
69-
return false;
70-
}
71-
}
72-
73-
//** This function removes a given group id from a given user.
74-
public function remove_group_from_user($userid,$groupid) {
75-
global $app;
76-
77-
$userid = intval($userid);
78-
$groupid = intval($groupid);
79-
80-
if($userid > 0 && $groupid > 0) {
81-
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid");
82-
$groups = explode(',',$user['groups']);
83-
$key = array_search($groupid,$groups);
84-
unset($groups[$key]);
85-
$groups_string = implode(',',$groups);
86-
$sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid";
87-
$app->db->query($sql);
88-
return true;
89-
} else {
90-
return false;
91-
}
92-
}
93-
94-
public function check_module_permissions($module) {
95-
// Check if the current user has the permissions to access this module
96-
if(!stristr($_SESSION["s"]["user"]["modules"],$module)) {
97-
// echo "LOGIN_REDIRECT:/index.php";
98-
header("Location: /index.php");
99-
exit;
100-
}
101-
}
102-
103-
104-
}
105-
1+
<?php
2+
3+
/*
4+
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
class auth {
32+
33+
public function is_admin() {
34+
if($_SESSION['s']['user']['typ'] == 'admin') {
35+
return true;
36+
} else {
37+
return false;
38+
}
39+
}
40+
41+
public function has_clients($userid) {
42+
global $app, $conf;
43+
44+
$userid = intval($userid);
45+
$client = $app->db->queryOneRecord("SELECT client.limit_client FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id");
46+
if($client['limit_client'] > 0) {
47+
return true;
48+
} else {
49+
return false;
50+
}
51+
}
52+
53+
//** This function adds a given group id to a given user.
54+
public function add_group_to_user($userid,$groupid) {
55+
global $app;
56+
57+
$userid = intval($userid);
58+
$groupid = intval($groupid);
59+
60+
if($userid > 0 && $groupid > 0) {
61+
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid");
62+
$groups = explode(',',$user['groups']);
63+
if(!in_array($groupid,$groups)) $groups[] = $groupid;
64+
$groups_string = implode(',',$groups);
65+
$sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid";
66+
$app->db->query($sql);
67+
return true;
68+
} else {
69+
return false;
70+
}
71+
}
72+
73+
//** This function removes a given group id from a given user.
74+
public function remove_group_from_user($userid,$groupid) {
75+
global $app;
76+
77+
$userid = intval($userid);
78+
$groupid = intval($groupid);
79+
80+
if($userid > 0 && $groupid > 0) {
81+
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid");
82+
$groups = explode(',',$user['groups']);
83+
$key = array_search($groupid,$groups);
84+
unset($groups[$key]);
85+
$groups_string = implode(',',$groups);
86+
$sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid";
87+
$app->db->query($sql);
88+
return true;
89+
} else {
90+
return false;
91+
}
92+
}
93+
94+
public function check_module_permissions($module) {
95+
// Check if the current user has the permissions to access this module
96+
if(!stristr($_SESSION["s"]["user"]["modules"],$module)) {
97+
// echo "LOGIN_REDIRECT:/index.php";
98+
header("Location: /index.php");
99+
exit;
100+
}
101+
}
102+
103+
104+
}
105+
106106
?>

0 commit comments

Comments
 (0)