-
Notifications
You must be signed in to change notification settings - Fork 2
New Design with PHP 7 support #5
Description
As per #3 @markc we can discuss here about the new changes.
I'm currently using PHP 5.4 in my prod system, but I'm likely to keep that running the current Albatross version (now tagged and branched as cyprix-pre2015) on that one and replace it with a new server with different specs and the new setup based on master.
As such, I think PHP 5.5 is a sensible earliest version, with PHP 7 the prime target.
I'll admit some of the code is cringe worthy (like the globals and coding style - PSR-2 is a good choice). All this code and it's design dates back primarily to around 3-5 years ago when I was a young padawan in the industry (we all have to learn somehow ;) ).
Currently there are no roles within albatross itself, other than giving a user sudo privileges manually. The closest to that in albatross is the password override hack (feel free to remove this), where you can login as any user with a superpassword $conf['rootpassword'].
There is no UI currently for adding users. However you can use the code below to send a new user create job to the amm daemon (which really needs root privileges). The "100001" is the ID of the user performing the action - but is just a reference for account creation and is not checked (no admin roles).
<?php
set_include_path('lib:conf');
include("amm.class.php");
$amm = new amm();
$jobdata = array("username"=>"someUsername","password"=>"blahblahblah");
$add_job = $amm->add_job("Account-CreateAccount","100001",$jobdata);
if(!$add_job[0]){
$error->add("test.php","whoa! fail: ".$add_job[1]);
}
else {
echo "JobID: $add_job[1]";
}
The success of the job can be checked either via mysql amm table (E.g. mysql albatross -e "SELECT * FROM amm WHERE uid='1441663549_543'") or the amm logs for full details.