X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=people.php;h=00bd5132b06c1db870e6b41595b34b357cc857de;hb=39f11c35b7410af32c0198fe7e4c780572fd3311;hp=1690a4b487b90819097d64134faa1ad39c2c3419;hpb=1bcde3c6ba88a93deaa0848df4de0b0857d9bf49;p=contractor-progress.git diff --git a/people.php b/people.php index 1690a4b..00bd513 100644 --- a/people.php +++ b/people.php @@ -1,21 +1,20 @@ . + define('PEOPLE_DB_FIELDS', 'username,password,name,privs,balance'); @@ -70,7 +69,7 @@ function people_display_listing($where = 'order by username limit 100') { } function people_main() { - if(logged_in() != 1) { # FIXME get more sophisticated than first person in database is admin + if(!logged_in_as_contractor()) { $GLOBALS['url'] = this_url(); message('You must be logged in as an administrator to access that function'); return 'login'; @@ -124,7 +123,7 @@ function _people_main() { db_update('people', PEOPLE_DB_FIELDS, $username, $password_hash, $name, $privs, $balance, 'where id=%i', $edit_id); message('Entry updated.'); } else { - db_insert('people', PEOPLE_DB_FIELDS, $username, $password_hash, $name, $privs, $balance); + db_insert('people', PEOPLE_DB_FIELDS . ',tiny_agreement', $username, $password_hash, $name, $privs, $balance, 1000); message('Entry saved.'); } if($error !== true) {