Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion install/install1.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function close() {
echo "</form>";
"</body>";
"</html>";
exit;
exit(1);
}

function exit_error($string){
Expand Down Expand Up @@ -87,6 +87,10 @@ function hashPassword($input, $rounds = 7) {
return crypt($input, sprintf('$2a$%02d$', $rounds) . $salt);
}

/* if started from commandline, wrap parameters to $_POST*/
if (!isset($_SERVER["HTTP_HOST"]))
parse_str($argv[1], $_POST);

if($_POST['adminpass'] != $_POST['adminrpass'])
exit_error('Admin passwords do not match');

Expand Down
18 changes: 13 additions & 5 deletions install/install2.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,28 @@
See LICENSE.TXT for details.
**********************************************************************/

/* if started from commandline, wrap parameters to $_POST */
if (!isset($_SERVER["HTTP_HOST"]))
parse_str($argv[1], $_POST);


include "../application/config/database.php";

$mysql = new mysqli($db['default']['hostname'], $db['default']['username'], $db['default']['password'], $db['default']['database']);

if ($server->connect_error) echo('Connection Error (' . $server->connect_errno . ') ' . $server->connect_error . '<br>');
if ($mysql->connect_error) {
echo('Connection Error (' . $mysql->connect_errno . ') ' . $mysql->connect_error . '<br>');
exit(2);
}

$mysql->multi_query("INSERT INTO `settings` (`id`, `name`, `value`) VALUES
('', 'recaptchapublic', '". $_POST['rpublic'] ."'),
('', 'recaptchaprivate', '". $_POST['rprivate'] ."'),
('', 'maxvotes', '20'),
('', 'maxvotes', '". ((isset($_POST['maxvotes']) && $_POST['maxvotes'] != '')? $_POST['maxvotes'] : 20)."'),
('', 'mainmail', '". $_POST['mainmail'] ."'),
('', 'title', '". $_POST['title'] ."'),
('', 'max_results', '10'),
('', 'language', 'english'),
('', 'max_results', '".((isset($_POST['max_results']) && $_POST['max_results'] != '')? $_POST['max_results'] : 10)."'),
('', 'language', '".(isset($_POST['language'])? $_POST['language'] : 'english')."'),
('', 'smtp-host', '". $_POST['smtp-host'] ."'),
('', 'smtp-port', '". $_POST['smtp-port'] ."'),
('', 'smtp-user', '". $_POST['smtp-user'] ."'),
Expand All @@ -32,4 +40,4 @@
header('Location: ../admin');
} else {
echo "PLEASE DELETE install/ FOLDER MANUALLY. THEN GO TO yourwebsite.com/feedback/admin/ TO LOG IN";
}
}