Example #1
0
if (!isset($user) || is_null($user) || !$user->isActive()) {
    exit;
}
// This admin functionality is for OPERATORS only
if (!$user->isAllowed(CS_ACTION::ADMINISTER_MEMBERS, CS_CONTEXT_TYPE::MEMBER, null)) {
    exit;
}
$sa_url = get_first_service_of_type(SR_SERVICE_TYPE::SLICE_AUTHORITY);
$ma_url = get_first_service_of_type(SR_SERVICE_TYPE::MEMBER_AUTHORITY);
$signer = $user;
// Handle the request, determine which action to perform
if (array_key_exists('action', $_REQUEST)) {
    $action = $_REQUEST['action'];
    if ($action == "remove") {
        if (array_key_exists('project_id', $_REQUEST) && array_key_exists('member_id', $_REQUEST)) {
            modify_project_membership($sa_url, $signer, $_REQUEST['project_id'], array(), array(), array($_REQUEST['member_id']));
        } else {
            print "Insufficient information given to remove user";
            exit;
        }
    } else {
        if ($action == "disable") {
            if (array_key_exists('member_urn', $_REQUEST)) {
                disable_user($ma_url, $signer, $_REQUEST['member_urn']);
            }
        } else {
            print "No action requested";
            exit;
        }
    }
}
Example #2
0
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 * 
 * 
 */
require_once __DIR__ . "/../../session.php";
require_once __DIR__ . "/../../moneyio.php";
open_session();
$user_id = $_GET["user_id"];
///$_POST["user_id"] was replaced by $_GET["rol_id"]
if (isset($_SESSION["mio-username"]) && !empty($_SESSION["mio-username"]) && isset($_SESSION["mio-username_id"]) && !empty($_SESSION["mio-username_id"]) && isset($_SESSION["mio-pic"]) && !empty($_SESSION["mio-pic"])) {
    if (isset($user_id) && !empty($user_id)) {
        require_once __DIR__ . "/user_func.php";
        if (disable_user($user_id)) {
            echo get_message("user_updated");
        } else {
            echo get_message("user_not_updated");
        }
    }
} else {
    echo get_message("no_session");
}