function activate_group($group_id) { global $feedback; //echo("activate_group($group_id)<br>"); if (sf_ldap_create_group($group_id, 0)) { db_query("UPDATE groups " . "SET status='A' " . "WHERE group_id={$group_id}"); /* Make founding admin be an active member of the project */ $admin_res = db_query("SELECT * " . "FROM users,user_group " . "WHERE user_group.group_id={$group_id} " . "AND user_group.admin_flags='A' " . "AND users.user_id=user_group.user_id "); if (db_numrows($admin_res) > 0) { $group =& group_get_object($group_id); // // user_get_object should really have a valid user_id passed in // or you are defeating the purpose of the object pooling // $admin =& user_get_object(db_result($admin_res, 0, 'user_id'), $admin_res); if ($group->addUser($admin->getUnixName())) { /* Now send the project approval emails */ group_add_history('approved', 'x', $group_id); send_new_project_email($group_id); usleep(250000); // TODO: This is dirty. If sendmail required pause, let send_new... handle it } else { $feedback = $group->getErrorMessage(); } } else { echo db_error(); } } else { /* There was error creating LDAP entry */ group_add_history('ldap:', sf_ldap_get_error_msg(), $group_id); } }
<?php // // SourceForge: Breaking Down the Barriers to Open Source Development // Copyright 1999-2000 (c) The SourceForge Crew // http://sourceforge.net // // $Id: newprojectmail.php,v 1.2 2003/11/13 11:29:21 helix Exp $ require 'pre.php'; require 'proj_email.php'; session_require(array('group' => '1', 'admin_flags' => 'A')); $HTML->header(array('title' => "Project Intro email")); send_new_project_email($group_id); print "<P>Mail successfully sent."; $HTML->footer(array());
/** * Make project available * * @param Project $project * * @return Boolean */ public function activate(Project $project) { $dao = $this->_getDao(); if ($dao->updateStatus($project->getId(), 'A')) { include_once 'proj_email.php'; group_add_history('approved', 'x', $project->getId()); $em = $this->getEventManager(); $em->processEvent('approve_pending_project', array('group_id' => $project->getId())); if (!send_new_project_email($project)) { $GLOBALS['Response']->addFeedback('warning', $project->getPublicName() . " - " . $GLOBALS['Language']->getText('global', 'mail_failed', array($GLOBALS['sys_email_admin']))); } return true; } return false; }
<?php // // SourceForge: Breaking Down the Barriers to Open Source Development // Copyright 1999-2000 (c) The SourceForge Crew // http://sourceforge.net // // require_once 'pre.php'; require_once 'proj_email.php'; session_require(array('group' => '1', 'admin_flags' => 'A')); $content = ""; $pm = ProjectManager::instance(); $group = $pm->getProject($request->getValidated('group_id', 'uint', 0)); if ($group && is_object($group) && !$group->isError()) { if (!send_new_project_email($group)) { $GLOBALS['feedback'] .= "<p>" . $group->getPublicName() . " - " . $GLOBALS['Language']->getText('global', 'mail_failed', array($GLOBALS['sys_email_admin'])) . "</p>"; } else { $content = "<p>" . $Language->getText('admin_newprojectmail', 'success') . "</p>"; } } site_header(array('title' => $Language->getText('admin_newprojectmail', 'title'))); print $content; site_footer(array());