Ejemplo n.º 1
0
            foreach ($config['system']['group'] as $gidx => $group) {
                if ($group['name'] == "all") {
                    if (!is_array($config['system']['group'][$gidx]['member'])) {
                        $config['system']['group'][$gidx]['member'] = array();
                    }
                    $config['system']['group'][$gidx]['member'][] = $userent['uid'];
                    break;
                }
            }
            $a_user[] = $userent;
        }
        /* Add user to groups so PHP can see the memberships properly or else the user's shell account does not get proper permissions (if applicable) See #5152. */
        local_user_set_groups($userent, $_POST['groups']);
        local_user_set($userent);
        /* Add user to groups again to ensure they are set everywhere, otherwise the user may not appear to be a member of the group. See commit:5372d26d9d25d751d16865ed9d46869d3b0ec5e1. */
        local_user_set_groups($userent, $_POST['groups']);
        write_config();
        if (is_dir("/etc/inc/privhooks")) {
            run_plugins("/etc/inc/privhooks");
        }
        conf_mount_ro();
        pfSenseHeader("system_usermanager.php");
    }
}
function build_priv_table()
{
    global $a_user, $id;
    $privhtml = '<div class="table-responsive">';
    $privhtml .= '<table class="table table-striped table-hover table-condensed">';
    $privhtml .= '<thead>';
    $privhtml .= '<tr>';
Ejemplo n.º 2
0
         } else {
             $userent['uid'] = $config['system']['nextuid']++;
             /* Add the user to All Users group. */
             foreach ($config['system']['group'] as $gidx => $group) {
                 if ($group['name'] == "all") {
                     if (!is_array($config['system']['group'][$gidx]['member'])) {
                         $config['system']['group'][$gidx]['member'] = array();
                     }
                     $config['system']['group'][$gidx]['member'][] = $userent['uid'];
                     break;
                 }
             }
             $a_user[] = $userent;
         }
         local_user_set($userent);
         local_user_set_groups($userent, $pconfig['groups']);
         write_config();
         if (!empty($pconfig['chkNewCert'])) {
             // redirect to cert manager when a new cert is requested for this user
             header("Location: system_certmanager.php?act=new&userid=" . (count($a_user) - 1));
         } else {
             header("Location: system_usermanager.php");
             exit;
         }
     }
 } elseif (isset($id)) {
     header("Location: system_usermanager.php?userid=" . $id);
     exit;
 } else {
     header("Location: system_usermanager.php");
     exit;