Ejemplo n.º 1
0
 /**
  *	getPermission - Return a Permission for this Group and the specified User.
  *
  *	@param	object	The user you wish to get permission for (usually the logged in user).
  *	@return	object	The Permission.
  */
 function &getPermission(&$_user)
 {
     return permission_get_object($this, $_user);
 }
Ejemplo n.º 2
0
# User rules
# 1. Must only contain alphanumeric chars or _ or -
# 2. Must be 3 - 15 chars
preg_match("/[[:alnum:]_-]{3,15}/", $env_user, $matches2);
if (count($matches) == 0) {
    exit_error('', 'Invalid CVS repository : ' . $env_group);
} else {
    if (count($matches2) == 0) {
        exit_error('', 'Invalid username : '******'', 'User "' . $userName . '"not found');
    }
    session_set_new($User->getID());
    $projectName = $matches[count($matches) - 1];
    $Group =& group_get_object_by_name($projectName);
    if (!$Group || !is_object($Group) || $Group->isError()) {
        exit_no_group();
    }
    $perm =& permission_get_object($Group, $User);
    if (!$perm || !is_object($perm) || !$perm->isCVSWriter()) {
        exit_permission_denied();
    }
}
exit(0);
// Local Variables:
// mode: php
// c-file-style: "bsd"
// End: