I made a very quick/dirty grants check to get the ball rolling in case anyone else wants to add a proper one to either the controller/step_3 or model/install:
Code: Select all
// In model/install.php after the line beginning "$db = new DB('mysql', $data['db_host'],..."
ini_set('display_errors', 1);
error_reporting(E_ALL);
// Check user permissions
function array_simplify($array) {
$new_array = array();
foreach($array as $key => $value) {
$new_array[$key] = reset($value);
}
return $new_array;
}
$required = array('CREATE','DROP','INSERT','UPDATE');
$query = $db->query("SHOW GRANTS");
$x = array_simplify($query->rows);
foreach($x as $grant) {
if(substr($grant,0,20) == "GRANT ALL PRIVILEGES") $required = array();
foreach($required as $nkey => $n) if(strpos($grant,$n)) unset($required[$nkey]);
}
if(count($required)) {
echo 'You need to grant these permissions for your SQL user:';
print_r($required);
exit;
}