removed unused global db-variables

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-11-17 12:31:15 +01:00
parent 97c6385c36
commit 0b3df4c7d7
2 changed files with 24 additions and 41 deletions

View File

@@ -25,29 +25,25 @@
* @param array $params Values which will be given to $yesfile. Format: array(variable1=>value1, variable2=>value2, variable3=>value3)
* @param string $targetname Name of the target eg Domain or eMail address etc.
* @param int $back_nr Number of steps to go back when "No" is pressed
*
*
* @author Florian Lippert <flo@syscp.org>
* @author Froxlor team <team@froxlor.org> (2010-)
*
*
* @return string outputs parsed question_yesno template
*/
function ask_yesno($text, $yesfile, $params = array(), $targetname = '', $back_nr = 1) {
function ask_yesno($text, $yesfile, $params = array(), $targetname = '', $back_nr = 1)
{
global $userinfo, $db, $s, $header, $footer, $lng, $theme;
global $userinfo, $s, $header, $footer, $lng, $theme;
$hiddenparams = '';
if(is_array($params))
{
foreach($params as $field => $value)
{
if (is_array($params)) {
foreach ($params as $field => $value) {
$hiddenparams.= '<input type="hidden" name="' . htmlspecialchars($field) . '" value="' . htmlspecialchars($value) . '" />' . "\n";
}
}
if(isset($lng['question'][$text]))
{
if (isset($lng['question'][$text])) {
$text = $lng['question'][$text];
}
@@ -56,27 +52,23 @@ function ask_yesno($text, $yesfile, $params = array(), $targetname = '', $back_n
exit;
}
function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true)
{
global $userinfo, $db, $s, $header, $footer, $lng, $theme;
function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true) {
global $userinfo, $s, $header, $footer, $lng, $theme;
$hiddenparams = '';
if(is_array($params))
{
foreach($params as $field => $value)
{
if (is_array($params)) {
foreach ($params as $field => $value) {
$hiddenparams.= '<input type="hidden" name="' . htmlspecialchars($field) . '" value="' . htmlspecialchars($value) . '" />' . "\n";
}
}
if(isset($lng['question'][$text]))
{
if (isset($lng['question'][$text])) {
$text = $lng['question'][$text];
}
if(isset($lng['question'][$chk_text]))
{
if (isset($lng['question'][$chk_text])) {
$chk_text = $lng['question'][$chk_text];
}
@@ -90,4 +82,3 @@ function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $
eval("echo \"" . getTemplate('misc/question_yesno_checkbox', '1') . "\";");
exit;
}

View File

@@ -25,15 +25,14 @@
* @author Florian Lippert <flo@syscp.org>
* @author Ron Brand <ron.brand@web.de>
*/
function standard_error($errors = '', $replacer = '') {
global $userinfo, $s, $header, $footer, $lng, $theme;
function standard_error($errors = '', $replacer = '')
{
global $db, $userinfo, $s, $header, $footer, $lng, $theme;
$_SESSION['requestData'] = $_POST;
$replacer = htmlentities($replacer);
if(!is_array($errors))
{
if (!is_array($errors)) {
$errors = array(
$errors
);
@@ -45,25 +44,18 @@ function standard_error($errors = '', $replacer = '')
}
$error = '';
foreach($errors as $single_error)
{
if(isset($lng['error'][$single_error]))
{
foreach ($errors as $single_error) {
if (isset($lng['error'][$single_error])) {
$single_error = $lng['error'][$single_error];
$single_error = strtr($single_error, array('%s' => $replacer));
}
else
{
} else {
$error = 'Unknown Error (' . $single_error . '): ' . $replacer;
break;
}
if(empty($error))
{
if (empty($error)) {
$error = $single_error;
}
else
{
} else {
$error.= ' ' . $single_error;
}
}