Commit 2a7e0bfe authored by Thomas Goirand's avatar Thomas Goirand

Install default roles in db_sync.php

parent aaa7fd63
......@@ -307,7 +307,27 @@ for($i=0;$i<$nbr_tables;$i++){
}
echo "\n";
# Check all expiration date that are 0000-00-00 and set them to the current date + 10 years
# This is a safety against user's stupidity...
### After all the db schema is in, perform the default INSERTs
$q = array();
$q[] = "INSERT IGNORE INTO `roles` (`id`, `name`) VALUES (1,'compute');";
$q[] = "INSERT IGNORE INTO `roles` (`id`, `name`) VALUES (2,'controller');";
$q[] = "INSERT IGNORE INTO `roles` (`id`, `name`) VALUES (3,'network');";
$q[] = "INSERT IGNORE INTO `roles` (`id`, `name`) VALUES (4,'volume');";
$q[] = "INSERT IGNORE INTO `roles` (`id`, `name`) VALUES (5,'sql');";
$q[] = "INSERT IGNORE INTO `roles` (`id`, `name`) VALUES (6,'messaging');";
$q[] = "INSERT IGNORE INTO `roles` (`id`, `name`) VALUES (7,'cephmon');";
$q[] = "INSERT IGNORE INTO `roles` (`id`, `name`) VALUES (8,'cephosd');";
$q[] = "INSERT IGNORE INTO `roles` (`id`, `name`) VALUES (9,'swiftproxy');";
$q[] = "INSERT IGNORE INTO `roles` (`id`, `name`) VALUES (10,'swiftstore');";
$q[] = "INSERT IGNORE INTO `roles` (`id`, `name`) VALUES (11,'custom');";
$q[] = "INSERT IGNORE INTO `roles` (`id`, `name`) VALUES (12,'network');";
foreach ($q as $sql){
$r = mysqli_query($con, $sql);
if($r === FALSE){
print("MySQL error: ". mysqli_error($con) . "\n");
print("when evaluating: $sql\n\n");
}
}
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment