function mswManSchemaFix($s) { if ($s->email == '' && $s->scriptpath == '' && $s->attachpath == '' && $s->attachhref == '') { $hdeskPath = 'http://www.example.com/helpdesk'; if (isset($_SERVER['HTTP_HOST']) && isset($_SERVER['PHP_SELF'])) { $hdeskPath = 'http' . (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'], 0, -10); } $hdeskPathAtt = $hdeskPath . '/content/attachments'; $hdeskPathFaq = $hdeskPath . '/content/attachments-faq'; $attachPath = mswSafeImportString(PATH . 'content/attachments'); $attFaqPath = mswSafeImportString(PATH . 'content/attachments-faq'); $apiKey = strtoupper(substr(md5(uniqid(rand(), 1)), 3, 10) . '-' . substr(md5(uniqid(rand(), 1)), 3, 8)); mysql_query("UPDATE `" . DB_PREFIX . "settings` SET\n `website` = 'My Help Desk',\n `email` = '*****@*****.**',\n `scriptpath` = '{$hdeskPath}',\n `attachpath` = '{$attachPath}',\n\t`attachhref` = '{$hdeskPathAtt}',\n\t`attachpathfaq` = '{$attFaqPath}',\n\t`attachhreffaq` = '{$hdeskPathFaq}',\n `adminFooter` = 'To add your own footer code, click "Settings & Tools > Other Options > Edit Footers"',\n `publicFooter` = 'To add your own footer code, click "Settings & Tools > Other Options > Edit Footers"',\n `prodKey` = '" . mswProdKeyGen() . "',\n `encoderVersion` = '" . (function_exists('ioncube_loader_version') ? ioncube_loader_version() : 'XX') . "',\n `softwareVersion` = '" . SCRIPT_VERSION . "',\n\t`apiKey` = '{$apiKey}'\n LIMIT 1\n ") or die(mswMysqlErrMsg(mysql_errno(), mysql_error(), __LINE__, __FILE__)); // Insert user.. if (mswRowCount('users') == 0) { mysql_query("INSERT INTO `" . DB_PREFIX . "users` (\n `id`, `ts`, `name`, `email`, `accpass`, `signature`, `notify`, `pageAccess`, `emailSigs`, `notePadEnable`, `delPriv`,\n `nameFrom`, `emailFrom`, `assigned`, `timezone`\n ) VALUES (\n 1, UNIX_TIMESTAMP(UTC_TIMESTAMP), 'admin', '*****@*****.**', '" . md5(SECRET_KEY . 'admin') . "', '', 'yes', '', 'no', 'yes', 'yes',\n '', '', 'no', 'Europe/London'\n )"); } else { mysql_query("UPDATE `" . DB_PREFIX . "users` SET\n\t `accpass` = '" . md5(SECRET_KEY . 'admin') . "'\n\t WHERE `id` = '1'\n\t "); } // Page reload.. header("Location: index.php"); exit; } }
<?php if (!defined('PARENT')) { exit; } // Check product key exists.. if ($SETTINGS->prodKey == '' || strlen($SETTINGS->prodKey) != 60) { $productKey = mswProdKeyGen(); mysql_query("UPDATE `" . DB_PREFIX . "settings` SET\n `prodKey` = '{$productKey}'\n ") or die(mswMysqlErrMsg(mysql_errno(), mysql_error(), __LINE__, __FILE__)); $SETTINGS->prodKey = $productKey; } // Update encoder version if not already.. if ($SETTINGS->encoderVersion == 'XX' && function_exists('ioncube_loader_version')) { mysql_query("UPDATE `" . DB_PREFIX . "settings` SET\n `encoderVersion` = '" . ioncube_loader_version() . "'\n ") or die(mswMysqlErrMsg(mysql_errno(), mysql_error(), __LINE__, __FILE__)); } ?> <div class="content"> <div class="header"> <h1 class="page-title"><?php echo $msg_adheader9; ?> </h1> <span class="clearfix"></span> </div> <ul class="breadcrumb"> <li class="active"><?php