Update reset_admin_password.sh
This commit is contained in:
parent
69baf03a07
commit
83b9327327
|
|
@ -9,14 +9,14 @@ cd "$(dirname "$0")"
|
|||
. ./environment.sh
|
||||
|
||||
#count the users
|
||||
admin_users=$(sudo -u postgres psql fusionpbx -Atc "select count(*) from v_users JOIN v_group_users USING (domain_uuid) where username='$system_username' and group_name = 'superadmin'")
|
||||
admin_users=$(sudo -u postgres psql fusionpbx -Atc "select count(*) from v_users JOIN v_user_groups USING (domain_uuid) where username='$system_username' and group_name = 'superadmin'")
|
||||
|
||||
if [ .$admin_users = .'0' ]; then
|
||||
error "i could not find the user '$system_username' in the database, check your resources/config.sh is correct"
|
||||
elif [ .$admin_users = .'' ]; then
|
||||
error "something went wrong, see errors above";
|
||||
else
|
||||
admin_uuids=$(sudo -u postgres psql fusionpbx -Atc "select v_users.user_uuid from v_users JOIN v_group_users USING (domain_uuid) where username='$system_username' and group_name = 'superadmin'")
|
||||
admin_uuids=$(sudo -u postgres psql fusionpbx -Atc "select v_users.user_uuid from v_users JOIN v_user_groups USING (domain_uuid) where username='$system_username' and group_name = 'superadmin'")
|
||||
for admin_uuid in $admin_uuids; do
|
||||
user_salt=$(/usr/bin/php /var/www/fusionpbx/resources/uuid.php);
|
||||
if [ .$system_password = .'random' ]; then
|
||||
|
|
|
|||
Loading…
Reference in New Issue