File inc/plan.inc.php changed (mode: 100644) (index 6e7db52..c443db4) |
... |
... |
function rg_plan_edit_high_level($db, &$rg) |
305 |
305 |
else |
else |
306 |
306 |
$id = 0; |
$id = 0; |
307 |
307 |
|
|
|
308 |
|
if ($id > 0) { |
|
309 |
|
$db_pi = rg_plan_info($db, $id); |
|
310 |
|
if ($db_pi['exists'] != 1) { |
|
311 |
|
$ret .= rg_warning('Invalid plan.'); |
|
312 |
|
return $ret; |
|
313 |
|
} |
|
314 |
|
} |
|
315 |
|
|
308 |
316 |
$ret = ""; |
$ret = ""; |
309 |
317 |
$pi = array(); |
$pi = array(); |
310 |
318 |
|
|
311 |
319 |
if ($rg['doit'] == 0) { |
if ($rg['doit'] == 0) { |
312 |
320 |
if ($id > 0) { |
if ($id > 0) { |
313 |
|
$pi = rg_plan_info($db, $id); |
|
314 |
|
if ($pi['exists'] != 1) { |
|
315 |
|
$ret .= rg_warning("Invalid plan."); |
|
316 |
|
return $ret; |
|
317 |
|
} |
|
|
321 |
|
$pi = $db_pi; |
318 |
322 |
} else { |
} else { |
319 |
323 |
// Defaults |
// Defaults |
320 |
324 |
$pi['id'] = 0; |
$pi['id'] = 0; |
|
... |
... |
function rg_plan_edit_high_level($db, &$rg) |
332 |
336 |
|
|
333 |
337 |
$errmsg = array(); |
$errmsg = array(); |
334 |
338 |
$load_form = TRUE; |
$load_form = TRUE; |
335 |
|
while (1) { |
|
336 |
|
if ($rg['doit'] != 1) |
|
337 |
|
break; |
|
338 |
|
|
|
339 |
|
$pi = array(); |
|
340 |
|
if ($id > 0) |
|
|
339 |
|
while ($rg['doit'] == 1) { |
|
340 |
|
if ($id > 0) { |
341 |
341 |
$pi['id'] = $id; |
$pi['id'] = $id; |
342 |
|
else |
|
|
342 |
|
} else { |
343 |
343 |
$pi['id'] = rg_var_uint("pi::id"); |
$pi['id'] = rg_var_uint("pi::id"); |
|
344 |
|
} |
344 |
345 |
$pi['name'] = rg_var_str("pi::name"); |
$pi['name'] = rg_var_str("pi::name"); |
345 |
346 |
$pi['description'] = trim(rg_var_str("pi::description")); |
$pi['description'] = trim(rg_var_str("pi::description")); |
346 |
347 |
$pi['disk_mb'] = rg_var_uint("pi::disk_mb"); |
$pi['disk_mb'] = rg_var_uint("pi::disk_mb"); |
File inc/user.inc.php changed (mode: 100644) (index c6a9323..c22be30) |
... |
... |
function rg_user_edit_high_level($db, $rg) |
2107 |
2107 |
break; |
break; |
2108 |
2108 |
} |
} |
2109 |
2109 |
|
|
|
2110 |
|
$pi = rg_plan_info($db, $ui['plan_id']); |
|
2111 |
|
if ($pi['exists'] != 1) { |
|
2112 |
|
$errmsg[] = 'invalid plan'; |
|
2113 |
|
break; |
|
2114 |
|
} |
|
2115 |
|
|
2110 |
2116 |
$ui_login = rg_ui_login(); |
$ui_login = rg_ui_login(); |
2111 |
2117 |
if (($ui_login['is_admin'] != 1) && ($ui['is_admin'] != 0)) { |
if (($ui_login['is_admin'] != 1) && ($ui['is_admin'] != 0)) { |
2112 |
2118 |
$errmsg[] = "you are not admin, you cannot give admin rights"; |
$errmsg[] = "you are not admin, you cannot give admin rights"; |
File tests/http_settings.php changed (mode: 100644) (index a254b82..35ae6ff) |
... |
... |
if ($r === FALSE) { |
135 |
135 |
} |
} |
136 |
136 |
rg_log_exit(); |
rg_log_exit(); |
137 |
137 |
|
|
|
138 |
|
rg_log(''); |
|
139 |
|
rg_log_enter('Create some fake plans'); |
|
140 |
|
$sql = 'INSERT INTO plans (id) VALUES (1000)'; |
|
141 |
|
$res = rg_sql_query($db, $sql); |
|
142 |
|
rg_cache_unset('plan::list', 0); |
|
143 |
|
rg_log_exit(); |
|
144 |
|
|
138 |
145 |
rg_log(''); |
rg_log(''); |
139 |
146 |
rg_log_enter('Posting edit info form'); |
rg_log_enter('Posting edit info form'); |
140 |
147 |
$session_time = intval($now / 393956); |
$session_time = intval($now / 393956); |
|
... |
... |
$data = array( |
144 |
151 |
"uid" => 4, |
"uid" => 4, |
145 |
152 |
"username" => $rg_ui['username'], |
"username" => $rg_ui['username'], |
146 |
153 |
"realname" => $rg_ui['realname'], |
"realname" => $rg_ui['realname'], |
147 |
|
"plan_id" => 5, |
|
148 |
|
"session_time" => $session_time |
|
149 |
|
); |
|
|
154 |
|
'plan_id' => 1000, |
|
155 |
|
'session_time' => $session_time); |
150 |
156 |
$headers = array(); |
$headers = array(); |
151 |
157 |
$r = do_req($info, $test_url . "/op/settings/edit_info?t=post_edit_info_form", $data, $headers); |
$r = do_req($info, $test_url . "/op/settings/edit_info?t=post_edit_info_form", $data, $headers); |
152 |
158 |
if (!strstr($r['body'], "Information has been successfully updated")) { |
if (!strstr($r['body'], "Information has been successfully updated")) { |
|
... |
... |
if (strcmp($rg_ui['realname'], $row['realname']) != 0) { |
167 |
173 |
rg_log_ml("realname has not been changed: " . print_r($row, TRUE)); |
rg_log_ml("realname has not been changed: " . print_r($row, TRUE)); |
168 |
174 |
exit(1); |
exit(1); |
169 |
175 |
} |
} |
170 |
|
if ($row['plan_id'] != 5) { |
|
|
176 |
|
if ($row['plan_id'] != 1000) { |
171 |
177 |
rg_log_ml('r: ' . print_r($r, TRUE)); |
rg_log_ml('r: ' . print_r($r, TRUE)); |
172 |
|
rg_log_ml("plan_id has not been changed: " . print_r($row, TRUE)); |
|
|
178 |
|
rg_log_ml("plan_id has not been changed to 1000: " . print_r($row, TRUE)); |
173 |
179 |
exit(1); |
exit(1); |
174 |
180 |
} |
} |
175 |
181 |
if ($row['session_time'] != $session_time) { |
if ($row['session_time'] != $session_time) { |