| | 92 | |
|---|
| | 93 | /* FreePBX has a 'back door' option that allows loging into the GUI with the dababase username/password as |
|---|
| | 94 | * admin user. We have disabled this ability by default but it has the potential to lock people out of |
|---|
| | 95 | * their systems on upgrade. Check to see if they have ANY admin users defined. If not, then set |
|---|
| | 96 | * AMP_ACCESS_DB_CREDS to true overriding the default so they can still access their GUI. |
|---|
| | 97 | */ |
|---|
| | 98 | if ($current_amp_conf['AUTHTYPE'] !='none') { |
|---|
| | 99 | outn(_("Checking number of admin users..")); |
|---|
| | 100 | $sql = "SELECT count(*) FROM ampusers WHERE sections = '*'"; |
|---|
| | 101 | $admin_users = $db->getOne($sql); |
|---|
| | 102 | if (DB::IsError($admin_users)) { |
|---|
| | 103 | out(_("error reading ampusers table")); |
|---|
| | 104 | } elseif (!$admin_users) { |
|---|
| | 105 | out(_("0 admins")); |
|---|
| | 106 | } |
|---|
| | 107 | if (DB::IsError($admin_users) || !$admin_users) { |
|---|
| | 108 | out(_("setting AMP_ACCESS_DB_CREDS to true")); |
|---|
| | 109 | out(_("[WARNING] this is a security risk, you should create an admin user and disable this vulnerability.")); |
|---|
| | 110 | } else { |
|---|
| | 111 | out(sprintf(_("%s admins"),$admin_users)); |
|---|
| | 112 | } |
|---|
| | 113 | } |
|---|
| | 114 | |
|---|