*/ require '../lib/class_mysqldb.php'; $db = new db($sql['host'], $sql['user'], $sql['password'], $sql['db']); unset($sql['password']); unset($db->password); $result = $db->query("SELECT `settinggroup`, `varname`, `value` FROM `" . TABLE_PANEL_SETTINGS . "`"); while ($row = $db->fetch_array($result)) { $settings[$row['settinggroup']][$row['varname']] = $row['value']; } unset($row); unset($result); /** * Inlcudes the Functions */ require '../lib/functions.php'; $updatelog = SysCPLogger::getInstanceOf(array('loginname' => 'updater'), $db, $settings); /** * First case: We are updating from a version < 1.0.10 */ if (!isset($settings['panel']['version']) || substr($settings['panel']['version'], 0, 3) == '1.0' && $settings['panel']['version'] != '1.0.10') { $updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.0 to 1.0.10"); include_once './updates/1.0/update_1.0_1.0.10.inc.php'; } /** * Second case: We are updating from version = 1.0.10 */ if ($settings['panel']['version'] == '1.0.10') { $updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.0.10 to 1.2-beta1"); include_once './updates/1.0/update_1.0.10_1.2-beta1.inc.php'; } /**
redirectTo('index.php'); exit; } /* * Initialize Template Engine */ $templatecache = array(); /* * Logic moved out of lng-file */ if (isset($userinfo['loginname']) && $userinfo['loginname'] != '') { $lng['menue']['main']['username'] .= $userinfo['loginname']; /* * Initialize logging */ $log = SysCPLogger::getInstanceOf($userinfo, $db, $settings); } /* * Fills variables for navigation, header and footer */ if (AREA == 'admin' || AREA == 'customer') { $navigation_data = loadConfigArrayDir('./lib/navigation/'); $navigation = buildNavigation($navigation_data[AREA], $userinfo); unset($navigation_data); } eval('$header = "' . getTemplate('header', '1') . '";'); eval('$footer = "' . getTemplate('footer', '1') . '";'); if (isset($_POST['action'])) { $action = $_POST['action']; } elseif (isset($_GET['action'])) { $action = $_GET['action'];
if (!$mail->Send()) { if ($mail->ErrorInfo != '') { $mailerr_msg = $mail->ErrorInfo; } else { $mailerr_msg = $email; } $rstlog = SysCPLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings); $rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg); redirectTo('index.php', array('showmessage' => '4'), true); exit; } $mail->ClearAddresses(); redirectTo('index.php', array('showmessage' => '1'), true); exit; } else { $rstlog = SysCPLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings); $rstlog->logAction(USR_ACTION, LOG_WARNING, "User '" . $loginname . "' tried to reset pwd but wasn't found in database!"); $message = $lng['login']['usernotfound']; } unset($user, $adminchecked); } else { $message = ''; } } else { $message = ''; } if ($settings['panel']['allow_preset'] != '1') { $message = $lng['pwdreminder']['notallowed']; } eval("echo \"" . getTemplate("fpwd") . "\";"); }
fwrite($debugHandler, 'SysCP Version and Database Version are correct' . "\n"); $cronbasedir = makeCorrectDir($pathtophpfiles . '/scripts/'); $crondir = new DirectoryIterator($cronbasedir); $cronfilename = basename($_SERVER['PHP_SELF'], '.php'); $cronscriptFullName = makeCorrectFile($cronbasedir . basename($_SERVER['PHP_SELF'])); $inc_crons = array(); foreach ($crondir as $file) { if (!$file->isDot() && !$file->isDir() && preg_match("/^" . $cronfilename . "\\.inc\\.(.*)\\.php\$/D", $file->getFilename())) { if (fileowner($cronscriptFullName) == $file->getOwner() && filegroup($cronscriptFullName) == $file->getGroup() && $file->isReadable()) { $inc_crons[] = $file->getPathname(); } else { fwrite($debugHandler, 'WARNING! uid and/or gid of "' . $cronscriptFullName . '" and "' . $file->getPathname() . '" don\'t match! Execution aborted!' . "\n"); fclose($debugHandler); die('WARNING! uid and/or gid of "' . $cronscriptFullName . '" and "' . $file->getPathname() . '" don\'t match! Execution aborted!'); } } } if (isset($inc_crons[0])) { natsort($inc_crons); foreach ($inc_crons as $cfile) { fwrite($debugHandler, 'Including ...' . $cfile . "\n"); include_once $cfile; } } unset($file, $crondir, $cronname, $cronscriptFullName, $cronfilename, $cronbasedir); fwrite($debugHandler, 'Functions have been included' . "\n"); /** * Initialize logging */ $cronlog = SysCPLogger::getInstanceOf(array('loginname' => 'cronjob'), $db, $settings); fwrite($debugHandler, 'Logger has been included' . "\n");