/**
* get_public_active_projects_asc() - Get a list of rows for public active projects (initially in trove/full_list)
*
- * @param int Opional Maximum number of rows to limit query length
+ * @param int $max_query_limit Optional Maximum number of rows to limit query length
+ * @return array List of public active projects
*/
function get_public_active_projects_asc($max_query_limit = -1) {
*
* Unlike updateAdmin(), this function accessible to project admin.
*
- * @param object $user User requesting operation (for access control).
+ * @param object $user User requesting operation (for access control).
* @param string $group_name
* @param string $homepage
* @param string $short_description
if ($res) {
$this->data_array['enable_pserver'] = $booleanparam;
db_commit();
+ return true;
} else {
db_rollback();
return false;
* added for Codendi compatibility
* usesServices - returns true if the group uses a particular plugin or feature
*
- * @param string name of the plugin
+ * @param string $feature name of the plugin
* @return boolean whether plugin is being used or not
*/
function usesService($feature) {
//
// Delete reporting
//
- $res = db_query_params('DELETE FROM rep_group_act_monthly WHERE group_id=$1',
+ db_query_params('DELETE FROM rep_group_act_monthly WHERE group_id=$1',
array($this->getID()));
//echo 'rep_group_act_monthly'.db_error();
- $res = db_query_params('DELETE FROM rep_group_act_weekly WHERE group_id=$1',
+ db_query_params('DELETE FROM rep_group_act_weekly WHERE group_id=$1',
array($this->getID()));
//echo 'rep_group_act_weekly'.db_error();
- $res = db_query_params('DELETE FROM rep_group_act_daily WHERE group_id=$1',
+ db_query_params('DELETE FROM rep_group_act_daily WHERE group_id=$1',
array($this->getID()));
//echo 'rep_group_act_daily'.db_error();
unset($this->data_array);
$members = $this->getUsers (true);
foreach ($members as $member) {
- $roles = array();
- foreach (RBACEngine::getInstance()->getAvailableRolesForUser ($member) as $role) {
- if ($role->getHomeProject() && $role->getHomeProject()->getID() == $this->getID()) {
- $roles[] = $role;
- }
+ $user_id = $member->getID();
+
+ if (!$SYS->sysCheckCreateGroup($this->getID())){
+ $this->setError($SYS->getErrorMessage());
+ db_rollback();
+ return false;
}
- foreach ($roles as $role) {
- if (!$this->addUser($member->getUnixName(),$role->getID())) {
- return false;
- }
+ if (!$SYS->sysCheckCreateUser($user_id)) {
+ $this->setError($SYS->getErrorMessage());
+ db_rollback();
+ return false;
+ }
+ if (!$SYS->sysGroupCheckUser($this->getID(),$user_id)) {
+ $this->setError($SYS->getErrorMessage());
+ db_rollback();
+ return false;
}
-
}
return true;
/**
* replaceTemplateStrings - fill-in some blanks with project name
*
- * @param string Template string
+ * @param string $string Template string
* @return string String after replacements
*/
function replaceTemplateStrings($string) {
/**
* approve - Approve pending project.
*
- * @param $user The User object who is doing the updating.
+ * @param object $user The User object who is doing the updating.
* @return bool
* @access public
*/
/**
* getUsers - Get the users of a group
*
+ * @param bool $onlylocal
* @return array of user's objects.
*/
function getUsers($onlylocal = true) {