getName() public method

Get the name of this user type.
public getName ( ) : string
return string
Ejemplo n.º 1
0
if (!SecurityToken::isValid()) {
    camp_html_display_error(getGS('Invalid security token!'));
    exit;
}

$canManage = $g_user->hasPermission('ManageUserTypes');
if (!$canManage) {
	$error = getGS("You do not have the right to delete user types.");
	camp_html_display_error($error);
	exit;
}

$uTypeId = Input::Get('UType', 'string', '');
if (is_numeric($uTypeId) && $uTypeId > 0) {
	$userType = new UserType($uTypeId);
	if (!$userType->exists()) {
		camp_html_display_error(getGS('No such user type.'));
		exit;
	}
	$userType->delete();
} else {
	camp_html_display_error(getGS('No such user type.'));
	exit;
}

$msg = getGS("User Type '$1' successfully deleted", $userType->getName());
camp_html_add_msg($msg, 'ok');
camp_html_goto_page("/$ADMIN/user_types/");

?>
Ejemplo n.º 2
0
<?php
require_once($GLOBALS['g_campsiteDir']. "/$ADMIN_DIR/user_types/utypes_common.php");
require_once($GLOBALS['g_campsiteDir']. "/$ADMIN_DIR/users/permission_list.php");
camp_load_translation_strings("users");

$canManage = $g_user->hasPermission('ManageUserTypes');
if (!$canManage) {
	$error = getGS("You do not have the right to change user type permissions.");
	camp_html_display_error($error);
	exit;
}

$uTypeId = Input::Get('UType', 'string', '');
if (is_numeric($uTypeId) && $uTypeId > 0) {
	$userType = new UserType($uTypeId);
	if ($userType->getName() == '') {
		camp_html_display_error(getGS('No such user type.'));
		exit;
	}
} else {
	camp_html_display_error(getGS('No such user type.'));
	exit;
}

$rights = camp_get_permission_list();

$crumbs = array();
$crumbs[] = array(getGS("Staff User Types"), "/$ADMIN/user_types/");
$crumbs[] = array(getGS("Change user type permissions"), "");
echo camp_html_breadcrumbs($crumbs);
Ejemplo n.º 3
0
			}
		?>
		</td>
		<td><?php echo htmlspecialchars($row['UName']); ?></TD>
		<td><?php echo htmlspecialchars($row['EMail']); ?></td>
		<?php if ($uType == "Subscribers" && $g_user->hasPermission("ManageSubscriptions")) { ?>
		<td><a href="<?php echo "/$ADMIN/users/subscriptions/?f_user_id=$userId"; ?>">
			<?php putGS("Subscriptions"); ?>
		</td>
		<?php } ?>

		<?php if ($uType == "Staff") { ?>
		<td><?php
                $userType = new UserType($editUser->getUserType());
                if ($userType) {
                    echo htmlspecialchars($userType->getName());
                }
                unset($userType);
        ?></td>
		<?php } ?>

		<td>
			<?php
				$creationDate = $row['time_created'];
				if ((int)$creationDate == 0) {
					putGS('N/A');
				} else {
					echo $creationDate;
				}
			?>
		</td>
Ejemplo n.º 4
0
if (!SecurityToken::isValid()) {
    camp_html_display_error(getGS('Invalid security token!'));
    exit;
}

$canManage = $g_user->hasPermission('ManageUserTypes');
if (!$canManage) {
	$error = getGS("You do not have the right to change user type permissions.");
	camp_html_display_error($error);
	exit;
}

$uTypeId = Input::Get('UType', 'string', '');
if (is_numeric($uTypeId) && $uTypeId > 0) {
	$userType = new UserType($uTypeId);
	if ($userType->getName() == '') {
		camp_html_display_error(getGS('No such user type.'));
		exit;
	}
} else {
	camp_html_display_error(getGS('No such user type.'));
	exit;
}

$rightsFields = User::GetDefaultConfig();
foreach ($rightsFields as $field=>$value) {
	$val = Input::Get($field, 'string', 'off');
	$userType->setPermission($field, ($val != 'off'));
}
$logtext = getGS('Permissions changed for user type "$1"', $userType->getName());
Log::Message($logtext, $userType->getName(), 123);