function send_new_project_email($group_id) { global $Language; $res_grp = db_query("SELECT * FROM groups WHERE group_id='" . db_ei($group_id) . "'"); if (db_numrows($res_grp) < 1) { echo $Language->getText('include_proj_email', 'g_not_exist', $group_id); } $row_grp = db_fetch_array($res_grp); $res_admins = db_query("SELECT user.user_name,user.email FROM user,user_group WHERE " . "user.user_id=user_group.user_id AND user_group.group_id='" . db_ei($group_id) . "' AND " . "user_group.admin_flags='A'"); $nb_recipients = db_numrows($res_admins); if ($nb_recipients < 1) { echo $Language->getText('include_proj_email', 'no_admin', $group_id); } // send one email per admin $nb_mail_failed = 0; $pm = ProjectManager::instance(); while ($row_admins = db_fetch_array($res_admins)) { $server = get_server_url(); $p = $pm->getProject($group_id); $host = $GLOBALS['sys_default_domain']; if ($p && $p->usesService('svn')) { $sf = new ServerFactory(); if ($s =& $sf->getServerById($p->services['svn']->getServerId())) { $host = URL::getHost($s->getUrl(session_issecure())); } } if ($GLOBALS['sys_force_ssl']) { $svn_url = 'https://' . $host; } else { $svn_url = 'http://svn.' . $row_grp['unix_group_name'] . '.' . $host; } $svn_url .= '/svnroot/' . $row_grp['unix_group_name']; // $message is defined in the content file include $Language->getContent('include/new_project_email'); // LJ Uncomment to test //echo $message; return $mail = new Mail(); $mail->setTo($row_admins['email']); $mail->setSubject($GLOBALS['sys_name'] . ' ' . $Language->getText('include_proj_email', 'proj_approve', $row_grp['unix_group_name'])); $mail->setBody($message); $mail->setFrom($GLOBALS['sys_email_admin']); if (!$mail->send()) { $nb_mail_failed++; } } return $nb_mail_failed < $nb_recipients; }
} // ########################## OTHER INFO print "<P><B>" . $Language->getText('admin_groupedit', 'other_info') . "</B>"; print "<br><u>" . $Language->getText('admin_groupedit', 'public') . "</u>: " . ($row_grp['is_public'] ? $Language->getText('global', 'yes') : $Language->getText('global', 'no')); print "<br><u>" . $Language->getText('admin_groupedit', 'unix_grp') . "</u>: {$row_grp['unix_group_name']}"; $currentproject->displayProjectsDescFieldsValue(); print "<br><u>" . $Language->getText('admin_groupedit', 'license_other') . "</u>: <br> {$row_grp['license_other']}"; $template_group = ProjectManager::instance()->getProject($row_grp['built_from_template']); print "<br><u>" . $Language->getText('admin_groupedit', 'built_from_template') . '</u>: <br> <A href="/projects/' . $template_group->getUnixName() . '"> <B> ' . $template_group->getPublicname() . ' </B></A>'; $sf = new ServerFactory(); if (count($sf->getAllServers()) > 1) { $p = $pm->getProject($row_grp['group_id']); if ($p->usesFile() || $p->usesSVN()) { print '<br><u>' . $Language->getText('admin_approve_pending', 'distributed_services') . '</u>:<br><ul>'; if ($p->usesFile()) { if ($s =& $sf->getServerById($p->services['file']->getServerId())) { print '<li>' . $Language->getText('project_admin_editservice', 'service_file_lbl_key') . ': ' . $s->getName() . '</li>'; } } if ($p->usesSVN()) { if ($s =& $sf->getServerById($p->services['svn']->getServerId())) { print '<li>' . $Language->getText('project_admin_editservice', 'service_svn_lbl_key') . ': ' . $s->getName() . '</li>'; } } print '</ul>'; } } ?> <TABLE WIDTH="70%"> <TR> <TD style="text-align:center">
svn_header(array('title' => $Language->getText('svn_intro', 'info'))); // Table for summary info print '<TABLE width="100%"><TR valign="top"><TD width="65%">' . "\n"; // Get group properties $res_grp = db_query("SELECT * FROM groups WHERE group_id=" . db_ei($group_id)); $row_grp = db_fetch_array($res_grp); $pm = ProjectManager::instance(); $p = $pm->getProject($group_id); // Show CVS access information if ($row_grp['svn_preamble'] != '') { echo $hp->purify(util_unconvert_htmlspecialchars($row_grp['svn_preamble']), CODENDI_PURIFIER_FULL); } else { $host = $GLOBALS['sys_default_domain']; if ($p && $p->usesService('svn')) { $sf = new ServerFactory(); if ($server =& $sf->getServerById($p->services['svn']->getServerId())) { $host = URL::getHost($server->getUrl(session_issecure())); } } if ($GLOBALS['sys_force_ssl']) { $svn_url = 'https://' . $host; } else { if (isset($GLOBALS['sys_disable_subdomains']) && $GLOBALS['sys_disable_subdomains']) { $svn_url = 'http://' . $host; } else { $svn_url = 'http://svn.' . $row_grp['unix_group_name'] . '.' . $host; } } // Domain name must be lowercase (issue with some SVN clients) $svn_url = strtolower($svn_url); $svn_url .= '/svnroot/' . $row_grp['unix_group_name'];