Fix users administration
authorMichal Novotny <minovotn@redhat.com>
Tue, 6 Dec 2011 13:08:39 +0000 (14:08 +0100)
committerMichal Novotny <minovotn@redhat.com>
Tue, 6 Dec 2011 13:08:39 +0000 (14:08 +0100)
Signed-off-by: Michal Novotny <mignov@gmail.com>

classes/language.php
init.php
lang/cs.php
lang/en.php
pages/users.php

index df9d2d5..3e4bb58 100644 (file)
                                        'user_deleted' => 'User has been succesfully deleted',
                                        'confirm_password' => 'Confirm password',
                                        'permissions' => 'Permissions',
+                                       'permission_basic' => 'Basic access',
                                        'permission_save_connection' => 'Save connection',
                                        'permission_vm_create' => 'Create virtual machine',
                                        'permission_vm_edit' => 'Edit virtual machine',
index f3fa430..d664521 100644 (file)
--- a/init.php
+++ b/init.php
@@ -8,18 +8,20 @@
        define('ALLOW_EXPERIMENTAL_VNC', false);
 
        /* User permission defines */
-       define('USER_PERMISSION_SAVE_CONNECTION', 0x01);
-       define('USER_PERMISSION_VM_CREATE', 0x02);
-       define('USER_PERMISSION_VM_EDIT', 0x04);
-       define('USER_PERMISSION_VM_DELETE', 0x08);
-       define('USER_PERMISSION_NETWORK_CREATE', 0x10);
-       define('USER_PERMISSION_NETWORK_EDIT', 0x20);
-       define('USER_PERMISSION_NETWORK_DELETE', 0x40);
-       define('USER_PERMISSION_USER_CREATE', 0x80);
-       define('USER_PERMISSION_USER_EDIT', 0x100);
-       define('USER_PERMISSION_USER_DELETE', 0x200);
+       define('USER_PERMISSION_BASIC', 0x01);
+       define('USER_PERMISSION_SAVE_CONNECTION', 0x02);
+       define('USER_PERMISSION_VM_CREATE', 0x04);
+       define('USER_PERMISSION_VM_EDIT', 0x08);
+       define('USER_PERMISSION_VM_DELETE', 0x10);
+       define('USER_PERMISSION_NETWORK_CREATE', 0x20);
+       define('USER_PERMISSION_NETWORK_EDIT', 0x40);
+       define('USER_PERMISSION_NETWORK_DELETE', 0x80);
+       define('USER_PERMISSION_USER_CREATE', 0x100);
+       define('USER_PERMISSION_USER_EDIT', 0x200);
+       define('USER_PERMISSION_USER_DELETE', 0x400);
 
        $user_permissions = array(
+                               'USER_PERMISSION_BASIC'                 => 'permission_basic',
                                'USER_PERMISSION_SAVE_CONNECTION'       => 'permission_save_connection',
                                'USER_PERMISSION_VM_CREATE'             => 'permission_vm_create',
                                'USER_PERMISSION_VM_EDIT'               => 'permission_vm_edit',
index 5f4416b..19aa4bd 100644 (file)
                                         'user_deleted' => 'Uživatel byl úspěšně smazán',
                                         'confirm_password' => 'Potvrzení hesla',
                                         'permissions' => 'Oprávnění',
+                                       'permission_basic' => 'Obecný přístup',
                                         'permission_save_connection' => 'Uložit nastavení',
                                         'permission_vm_create' => 'Vytvořit virtuální stroj',
                                         'permission_vm_edit' => 'Upravit virtuální stroj',
index 9897fe9..735bf14 100644 (file)
                                         'user_deleted' => 'User has been succesfully deleted',
                                         'confirm_password' => 'Confirm password',
                                         'permissions' => 'Permissions',
+                                       'permission_basic' => 'Basic access',
                                         'permission_save_connection' => 'Save connection',
                                         'permission_vm_create' => 'Create virtual machine',
                                         'permission_vm_edit' => 'Edit virtual machine',
index df7d7b4..8640e8c 100644 (file)
 
        while (list($key, $value) = each($user_permissions)) {
                $val = in_array($key, $p_perms) ? 'checked="checked"' : '';
+               if ($key == 'USER_PERMISSION_BASIC')
+                       $val = 'checked="checked" disabled="disabled"';
                echo "<input type=\"checkbox\" name=\"perm[]\" value=\"$key\" $val $readonly_perms/> ".$lang->get($value)."<br />";
        }
 ?>
        <a href="?page=users&amp;action=edit&amp;user_id=<?php echo $users[$i]['id'] ?>">
                <?php echo $lang->get('user_edit') ?>
        </a>
+       |
        <a href="?page=users&amp;action=del&amp;user_id=<?php echo $users[$i]['id'] ?>">
                <?php echo $lang->get('user_del') ?>
        </a>