Пример #1
0
function getHelp($section = '')
{
    if (trim($section) !== '' && $section[0] !== '#') {
        $section = '#' . $section;
    }
    return '<a href="javascript:help_window(\'' . get_server_url() . '/plugins/pluginsadministration/documentation/' . UserManager::instance()->getCurrentUser()->getLocale() . '/' . $section . '\');">[?]</a>';
}
Пример #2
0
 function _getHelp($section = '')
 {
     if (trim($section) !== '' && $section[0] !== '#') {
         $section = '#' . $section;
     }
     return '<b><a href="javascript:help_window(\'' . get_server_url() . '/documentation/user_guide/html/' . UserManager::instance()->getCurrentUser()->getLocale() . '/IMPlugin.html' . $section . '\');">' . $GLOBALS['Language']->getText('global', 'help') . '</a></b>';
 }
Пример #3
0
 public function getUrl()
 {
     if ($this->hasLogo()) {
         return get_server_url() . '/themes/' . $this->theme . '/images/organization_logo.png';
     }
     return null;
 }
Пример #4
0
function send_new_user_email($to, $login, $password, $confirm_hash, $template, $isAdminPresenter)
{
    //needed by new_user_email.txt
    $base_url = get_server_url();
    $defaultTheme = $GLOBALS['sys_themedefault'];
    $color_logo = "#0000";
    $color_button = "#347DBA";
    if (themeIsFlamingParrot($defaultTheme)) {
        $defaultThemeVariant = $GLOBALS['sys_default_theme_variant'];
        $color_logo = FlamingParrot_Theme::getColorOfCurrentTheme($defaultThemeVariant);
        $color_button = $color_logo;
    }
    $logo_url = $base_url . "/themes/" . $defaultTheme . "/images/organization_logo.png";
    $has_logo = file_exists(dirname(__FILE__) . '/../themes/' . $defaultTheme . '/images/organization_logo.png');
    if ($isAdminPresenter) {
        $subject = $GLOBALS['Language']->getText('account_register', 'welcome_email_title', $GLOBALS['sys_name']);
        include $GLOBALS['Language']->getContent('account/new_account_email');
        $presenter = new MailRegisterByAdminPresenter($has_logo, $logo_url, $title, $section_one, $section_two, $section_after_login, $thanks, $signature, $help, $color_logo, $login, $section_three, $section_after_password, $password);
    } else {
        $subject = $GLOBALS['Language']->getText('include_proj_email', 'account_register', $GLOBALS['sys_name']);
        include $GLOBALS['Language']->getContent('include/new_user_email');
        $redirect_url = $base_url . "/account/verify.php?confirm_hash={$confirm_hash}";
        $presenter = new MailRegisterByUserPresenter($has_logo, $logo_url, $title, $section_one, $section_two, $section_after_login, $thanks, $signature, $help, $color_logo, $login, $redirect_url, $redirect_button, $color_button);
    }
    $renderer = TemplateRendererFactory::build()->getRenderer(ForgeConfig::get('codendi_dir') . '/src/templates/mail/');
    $mail = initializeMail($subject, $GLOBALS['sys_noreply'], $to, $renderer->renderToString($template, $presenter), $message);
    return $mail->send();
}
Пример #5
0
 private function getQueryHost()
 {
     if (isset($_SERVER['HTTP_HOST'])) {
         $scheme = isset($_SERVER['HTTPS']) ? 'https://' : 'http://';
         return $this->getUrlBase($scheme . $_SERVER['HTTP_HOST']);
     }
     return $this->getUrlBase(get_server_url());
 }
Пример #6
0
function send_approval_new_user_email($to, $login)
{
    //needed by new_user_email.txt
    $base_url = get_server_url();
    $presenter = new MailPresenterFactory();
    $renderer = TemplateRendererFactory::build()->getRenderer(ForgeConfig::get('codendi_dir') . '/src/templates/mail/');
    $mail = new TuleapRegisterMail($presenter, $renderer, "mail-admin-approval");
    $mail = $mail->getMail($login, '', '', $base_url, $GLOBALS['sys_noreply'], $to, "admin-approval");
    return $mail->send();
}
 /**
  * Send a mail when PDF Watermarking is disabled.
  * 
  * @param Docman_Item $item
  * @param User        $currentUser
  * 
  * @return void
  */
 public function notifyOnDisable($item, $currentUser, $defaultUrl)
 {
     $admins = $this->getPeopleToNotifyWhenWatermarkingIsDisabled($item);
     $link = get_server_url() . $defaultUrl . '&action=details&id=' . $item->getId();
     $mail = new Mail();
     $mail->setTo(implode(',', $admins));
     $mail->setSubject($GLOBALS['Language']->getText('plugin_docmanwatermark', 'email_disable_watermark_subject', array($item->getTitle())));
     $mail->setBody($GLOBALS['Language']->getText('plugin_docmanwatermark', 'email_disable_watermark_body', array($item->getTitle(), $currentUser->getRealname(), $link)));
     $mail->send();
 }
 /**
  * @param Tracker_Artifact        $artifact The child
  * @param Tracker_Artifact        $parent   The parent
  * @param Tracker_Semantic_Status $semantic The status semantic used by the corresponding tracker
  */
 public function __construct(Tracker_Artifact $artifact, Tracker_Artifact $parent, Tracker_Semantic_Status $semantic)
 {
     $base_url = get_server_url();
     $this->xref = $artifact->getXRef();
     $this->title = $artifact->getTitle();
     $this->id = $artifact->getId();
     $this->url = $base_url . $artifact->getUri();
     $this->status = $semantic->getStatus($artifact);
     $this->parent_id = $parent->getId();
     $this->has_children = $artifact->hasChildren();
 }
 private function sendErrorNotification(GitRepository $repository)
 {
     $user = $this->getRequester();
     if (!$user->isAnonymous()) {
         $factory = new BaseLanguageFactory();
         $language = $factory->getBaseLanguage($user->getLocale());
         $url = get_server_url() . GIT_BASE_URL . '/?action=repo_management&group_id=' . $repository->getProjectId() . '&repo_id=' . $repository->getId() . '&pane=gerrit';
         $notification = new Notification(array($user->getEmail()), $language->getText('plugin_git', 'delegated_to_gerrit_error_mail_subject', array($repository->getFullName())), $language->getText('plugin_git', 'delegated_to_gerrit_error_mail_body', array($repository->getFullName(), $url)), $language->getText('plugin_git', 'delegated_to_gerrit_error_mail_body', array($repository->getFullName(), $url)), $url, 'git');
         $this->mail_builder->buildAndSendEmail($repository->getProject(), $notification, new MailEnhancer());
     }
 }
Пример #10
0
 public function createDomDocument()
 {
     $impl = new DOMImplementation();
     $dtd = $impl->createDocumentType('docman', '', get_server_url() . '/plugins/docman/docman-1.0.dtd');
     $doc = $impl->createDocument('', '', $dtd);
     $doc->encoding = 'UTF-8';
     $doc->standalone = 'no';
     $doc->version = '1.0';
     $doc->formatOutput = true;
     return $doc;
 }
Пример #11
0
 function _getHelp($section = '', $questionmark = false)
 {
     if (trim($section) !== '' && $section[0] !== '#') {
         $section = '#' . $section;
     }
     if ($questionmark) {
         $help_label = '[?]';
     } else {
         $help_label = $GLOBALS['Language']->getText('global', 'help');
     }
     return '<b><a href="javascript:help_window(\'' . get_server_url() . '/documentation/user_guide/html/' . UserManager::instance()->getCurrentUser()->getLocale() . '/ContinuousIntegrationWithHudson.html' . $section . '\');">' . $help_label . '</a></b>';
 }
Пример #12
0
function send_new_user_email($to, $confirm_hash, $username)
{
    //needed by new_user_email.txt
    $base_url = get_server_url();
    include $GLOBALS['Language']->getContent('include/new_user_email');
    $mail = new Mail();
    $mail->setTo($to);
    $mail->setSubject($GLOBALS['Language']->getText('include_proj_email', 'account_register', $GLOBALS['sys_name']));
    $mail->setBody($message);
    $mail->setFrom($GLOBALS['sys_noreply']);
    return $mail->send();
}
Пример #13
0
 public function sendMail(PFUser $user, Project $project, $tv3_id, $tracker_name)
 {
     $mail = new Codendi_Mail();
     $breadcrumbs = array();
     $breadcrumbs[] = '<a href="' . get_server_url() . '/projects/' . $project->getUnixName(true) . '" />' . $project->getPublicName() . '</a>';
     $mail->getLookAndFeelTemplate()->set('breadcrumbs', $breadcrumbs);
     $mail->addAdditionalHeader("X-Codendi-Project", $project->getUnixName());
     $mail->setFrom($GLOBALS['sys_noreply']);
     $mail->setTo($user->getEmail());
     $mail->setSubject('Output of your migration TV3 -> TV5');
     $mail->setBody($this->getMailBody($tv3_id, $tracker_name));
     $mail->send();
     $this->purgeLogStack();
 }
Пример #14
0
function send_new_user_email($to, $confirm_hash, $username)
{
    global $Language;
    $base_url = get_server_url();
    // $message is defined in the content file
    include $Language->getContent('include/new_user_email');
    list($host, $port) = explode(':', $GLOBALS['sys_default_domain']);
    $mail = new Mail();
    $mail->setTo($to);
    $mail->setSubject($Language->getText('include_proj_email', 'account_register', $GLOBALS['sys_name']));
    $mail->setBody($message);
    $mail->setFrom($GLOBALS['sys_noreply']);
    return $mail->send();
}
Пример #15
0
 public function finish_login()
 {
     try {
         $return_url = get_server_url() . '/my';
         if ($this->request->existAndNonEmpty('return_to')) {
             $return_url = $this->request->getValidated('return_to', 'string', '');
         }
         $driver = new Openid_Driver_ConnexionDriver($this->logger, '?func=' . OpenId_OpenIdRouter::FINISH_LOGIN);
         $connexion_manager = new Openid_ConnexionManager($driver);
         $identity_url = $connexion_manager->finishAuthentication($return_url);
         $this->account_manager->authenticateCorrespondingUser($identity_url);
         $this->response->redirect($return_url);
     } catch (OpenId_OpenIdException $exception) {
         $this->response->addFeedback(Feedback::ERROR, $exception->getMessage());
     }
     $this->response->redirect('/account/login');
 }
Пример #16
0
 public function notifyAdministrator(PFuser $user)
 {
     $user_name = $user->getUserName();
     $href_approval = get_server_url() . '/admin/approve_pending_users.php?page=pending';
     $from = ForgeConfig::get('sys_noreply');
     $to = ForgeConfig::get('sys_email_admin');
     $subject = $GLOBALS['Language']->getText('account_register', 'mail_approval_subject', $user_name);
     $body = stripcslashes($GLOBALS['Language']->getText('account_register', 'mail_approval_body', array(ForgeConfig::get('sys_name'), $user_name, $href_approval)));
     $mail = new Mail();
     $mail->setSubject($subject);
     $mail->setFrom($from);
     $mail->setTo($to, true);
     $mail->setBody($body);
     if (!$mail->send()) {
         $GLOBALS['Response']->addFeedback(Feedback::ERROR, $GLOBALS['Language']->getText('global', 'mail_failed', $to));
     }
 }
Пример #17
0
 /**
  * Create a presenter for email account.
  *
  * @return MailRegisterPresenter
  */
 public function createMailAccountPresenter($login, $password, $confirm_hash, $presenter_role, $logo_url)
 {
     $color_logo = "#000";
     $color_button = "#347DBA";
     $base_url = get_server_url();
     $this->setColorTheme($color_logo, $color_button);
     $attributes_presenter = array("login" => $login, "password" => $password, "color_logo" => $color_logo, "color_button" => $color_button, "confirm_hash" => $confirm_hash, "base_url" => $base_url, "logo_url" => $logo_url);
     if ($presenter_role === "user") {
         $presenter = $this->createUserEmailPresenter($attributes_presenter);
     } else {
         if ($presenter_role === "admin") {
             $presenter = $this->createAdminEmailPresenter($attributes_presenter);
         } else {
             if ($presenter_role === "admin-notification") {
                 $presenter = $this->createAdminNotificationPresenter($attributes_presenter);
             } else {
                 $presenter = $this->createApprovalEmailPresenter($attributes_presenter);
             }
         }
     }
     return $presenter;
 }
Пример #18
0
function svn_header_admin($params)
{
    global $group_id, $Language;
    //required params for site_project_header();
    $params['group'] = $group_id;
    $params['toptab'] = 'svn';
    $project = ProjectManager::instance()->getProject($group_id);
    $service = $project->getService('svn');
    if (!$service) {
        exit_error($Language->getText('global', 'error'), $Language->getText('svn_utils', 'svn_off'));
    }
    $toolbar = array();
    $toolbar[] = array('title' => $Language->getText('svn_utils', 'admin'), 'url' => '/svn/admin/?group_id=' . $group_id);
    $toolbar[] = array('title' => $Language->getText('svn_admin_index', 'gen_sett'), 'url' => '/svn/admin/?func=general_settings&group_id=' . $group_id);
    $toolbar[] = array('title' => $Language->getText('svn_admin_index', 'access'), 'url' => '/svn/admin/?func=access_control&group_id=' . $group_id);
    $toolbar[] = array('title' => $Language->getText('svn_utils', 'notif'), 'url' => '/svn/admin/?func=notification&group_id=' . $group_id);
    if (!$params['help']) {
        $params['help'] = "svn.html#subversion-administration-interface";
    }
    $toolbar[] = array('title' => $Language->getText('global', 'help'), 'url' => 'javascript:help_window(\'' . get_server_url() . '/doc/' . UserManager::instance()->getCurrentUser()->getShortLocale() . '/user-guide/' . $params['help'] . '\');');
    $service->displayHeader($params['title'], array(array('title' => $params['title'], 'url' => '/svn/?group_id=' . $group_id)), $toolbar);
}
 /**
  * Get the Url to the artifact link
  *
  * @return string the html code (a href) to this artifact link
  */
 public function getUrl()
 {
     $server_url = get_server_url();
     return '<a class="cross-reference" href="' . $server_url . '/goto?key=' . $this->getKeyword() . '&val=' . $this->getArtifactId() . '&group_id=' . $this->getGroupId() . '">' . $this->getLabel() . '</a>';
 }
Пример #20
0
 /**
  * displayRSS
  * 
  * Display the follow-ups of this artifact as a rss feed
  *
  */
 function displayRSS()
 {
     $uh = UserHelper::instance();
     $hp = Codendi_HTMLPurifier::instance();
     $group = $this->ArtifactType->getGroup();
     $rss = new RSS(array('title' => $group->getPublicName() . ' ' . $this->ArtifactType->getName() . ' #' . $this->getId() . ' - ' . $this->getValue('summary') . ' - ' . $GLOBALS['Language']->getText('tracker_include_artifact', 'follow_ups'), 'description' => '', 'link' => '<![CDATA[' . get_server_url() . '/tracker/?atid=' . $this->ArtifactType->getID() . '&group_id=' . $group->getGroupId() . ']]>', 'language' => 'en-us', 'copyright' => $GLOBALS['Language']->getText('rss', 'copyright', array($GLOBALS['sys_long_org_name'], $GLOBALS['sys_name'], date('Y', time()))), 'pubDate' => gmdate('D, d M Y h:i:s', $this->getLastUpdateDate()) . ' GMT'));
     $result = $this->getFollowups();
     for ($i = 0; $i < db_numrows($result); $i++) {
         $comment_type = db_result($result, $i, 'comment_type');
         $comment_type_id = db_result($result, $i, 'comment_type_id');
         $comment_id = db_result($result, $i, 'artifact_history_id');
         $field_name = db_result($result, $i, 'field_name');
         $orig_subm = $this->getOriginalCommentSubmitter($comment_id);
         $orig_date = $this->getOriginalCommentDate($comment_id);
         if ($comment_type_id == 100 || $comment_type == "") {
             $comment_type = '';
         } else {
             $comment_type = '<strong>[' . $comment_type . ']</strong><br />';
         }
         $rss->addItem(array('title' => '<![CDATA[' . $GLOBALS['Language']->getText('tracker_include_artifact', 'add_flup_comment') . ' #' . $comment_id . ']]>', 'description' => '<![CDATA[' . $comment_type . util_make_links(nl2br(db_result($result, $i, 'new_value')), $group->getGroupId(), $this->ArtifactType->getID()) . ']]>', 'pubDate' => gmdate('D, d M Y h:i:s', db_result($orig_date, 0, 'date')) . ' GMT', 'dc:creator' => $hp->purify($uh->getDisplayNameFromUserId(db_result($orig_subm, 0, 'mod_by'))), 'link' => '<![CDATA[' . get_server_url() . '/tracker/?func=detail&aid=' . $this->getId() . '&atid=' . $this->ArtifactType->getID() . '&group_id=' . $group->getGroupId() . '#comment_' . $comment_id . ']]>', 'guid' => '<![CDATA[' . get_server_url() . '/tracker/?func=detail&aid=' . $this->getId() . '&atid=' . $this->ArtifactType->getID() . '&group_id=' . $group->getGroupId() . '#comment_' . $comment_id . ']]>'));
     }
     $rss->display();
     exit;
 }
Пример #21
0
<?php

// ## export sf front page news in RSS
require_once 'pre.php';
header("Content-Type: text/xml");
// ## group_id must be specified
$res_grp = db_query("SELECT group_id,group_name FROM groups '\n\t.'WHERE access != '" . db_es(Project::ACCESS_PRIVATE) . "' AND status='A' AND group_id=" . db_ei($group_id));
if (db_numrows($res_grp) < 1) {
    print $Language->getText('export_nitf_sfforums', 'g_id_err');
    exit;
} else {
    $row_grp = db_fetch_array($res_grp);
}
print '<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sf_forum SYSTEM "' . get_server_url() . '/exports/sf_forum_0.1.dtd">
';
print "<group name=\"{$row_grp['group_name']}\">";
$res_forum = db_query('SELECT group_forum_id,forum_name FROM forum_group_list ' . 'WHERE group_id=' . $group_id);
while ($row_forum = db_fetch_array($res_forum)) {
    print " <forum name=\"{$row_forum['forum_name']}\">\n";
    $res_post = db_query('SELECT forum.msg_id AS msg_id,forum.subject AS subject,' . 'forum.body AS body,forum.date AS date,user.user_name AS user_name,' . 'user.realname AS realname FROM forum,user ' . 'WHERE forum.posted_by=user.user_id AND forum.group_forum_id=' . $row_forum[group_forum_id]);
    // ## item outputs
    while ($row_post = db_fetch_array($res_post)) {
        print "  <nitf version=\"XMLNews/DTD XMLNEWS-STORY 1.8//EN\">\n";
        print "   <head>\n";
        print "    <title>{$row_post['subject']}</title>\n";
        print "   </head>\n";
        print "   <body><body.content><block>\n";
        print $row_post[body];
        print "   </block></body.content></body>\n";
        print "  </nitf>\n";
Пример #22
0
 public function notSiteAdmin()
 {
     $this->response->redirect(get_server_url());
 }
Пример #23
0
/**
 * Copyright Enalean (c) 2013. All rights reserved.
 *
 * Tuleap and Enalean names and logos are registrated trademarks owned by
 * Enalean SAS. All other trademarks or names are properties of their respective
 * owners.
 *
 * This file is a part of Tuleap.
 *
 * Tuleap is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
 */
require_once 'pre.php';
$plugin_manager = PluginManager::instance();
$plugin = $plugin_manager->getPluginByName('openid');
if ($plugin && $plugin_manager->isPluginAvailable($plugin)) {
    $plugin->process(HTTPRequest::instance(), $GLOBALS['HTML']);
} else {
    header('Location: ' . get_server_url());
}
Пример #24
0
 /**
  * Display the list of attached files
  *
  * @param group_id: the group id
  * @param group_artifact_id: the artifact type ID
  * @param ascii: ascii mode
  *
  * @return void
  */
 function showAttachedFiles($group_id, $group_artifact_id, $ascii = false, $pv = 0)
 {
     global $Language;
     $hp = $this->getHtmlPurifier();
     //
     //  show the files attached to this artifact
     //
     $result = $this->getAttachedFiles();
     $rows = db_numrows($result);
     // No file attached -> return now
     if ($rows <= 0) {
         if ($ascii) {
             $out = $Language->getText('tracker_include_artifact', 'no_file_attached') . $GLOBALS['sys_lf'];
         } else {
             $out = '<H4>' . $Language->getText('tracker_include_artifact', 'no_file_attached') . '</H4>';
         }
         return $out;
     }
     // Header first
     if ($ascii) {
         $out = $Language->getText('tracker_include_artifact', 'file_attachment') . $GLOBALS['sys_lf'] . str_repeat("*", strlen($Language->getText('tracker_include_artifact', 'file_attachment')));
     } else {
         $title_arr = array();
         $title_arr[] = $Language->getText('tracker_include_artifact', 'name');
         $title_arr[] = $Language->getText('tracker_include_artifact', 'desc');
         $title_arr[] = $Language->getText('tracker_include_artifact', 'size_kb');
         $title_arr[] = $Language->getText('global', 'by');
         $title_arr[] = $Language->getText('tracker_include_artifact', 'posted_on');
         if ($pv == 0) {
             $title_arr[] = $Language->getText('tracker_include_canned', 'delete');
         }
         $out = html_build_list_table_top($title_arr);
     }
     // Determine what the print out format is based on output type (Ascii, HTML)
     if ($ascii) {
         $fmt = $GLOBALS['sys_lf'] . $GLOBALS['sys_lf'] . "------------------------------------------------------------------" . $GLOBALS['sys_lf'] . $Language->getText('tracker_import_utils', 'date') . ": %s  " . $Language->getText('tracker_include_artifact', 'name') . ": %s  " . $Language->getText('tracker_include_artifact', 'size') . ": %dKB   " . $Language->getText('global', 'by') . ": %s" . $GLOBALS['sys_lf'] . "%s" . $GLOBALS['sys_lf'] . "%s";
     } else {
         $fmt = "" . $GLOBALS['sys_lf'] . '<TR class="%s"><td>%s</td><td>%s</td><td align="center">%s</td><td align="center">%s</td><td align="center">%s</td>';
         if ($pv == 0) {
             $fmt .= '<td align="center">%s</td>';
         }
         $fmt .= '</tr>';
     }
     // Determine which protocl to use for embedded URL in ASCII format
     $server = get_server_url();
     // Loop throuh the attached files and format them
     for ($i = 0; $i < $rows; $i++) {
         $artifact_file_id = db_result($result, $i, 'id');
         $href = "/tracker/download.php?artifact_id=" . (int) $this->getID() . "&id=" . (int) $artifact_file_id;
         if ($ascii) {
             $out .= sprintf($fmt, format_date($GLOBALS['Language']->getText('system', 'datefmt'), db_result($result, $i, 'adddate')), db_result($result, $i, 'filename'), intval(db_result($result, $i, 'filesize') / 1024), db_result($result, $i, 'user_name'), SimpleSanitizer::unsanitize(db_result($result, $i, 'description')), $server . $href);
         } else {
             // show CC delete icon if one of the condition is met:
             // (a) current user is group member
             // (b) the current user is the person who added a gieven name in CC list
             if (user_ismember($this->ArtifactType->getGroupID()) || user_getname(user_getid()) == db_result($result, $i, 'user_name')) {
                 $html_delete = '<a href="?func=delete_file&group_id=' . (int) $group_id . "&atid=" . (int) $group_artifact_id . "&aid=" . (int) $this->getID() . "&id=" . (int) db_result($result, $i, 'id') . '" ' . ' onClick="return confirm(\'' . $Language->getText('tracker_include_artifact', 'delete_attachment') . '\')">' . '<IMG SRC="' . util_get_image_theme("ic/trash.png") . '" HEIGHT="16" WIDTH="16" BORDER="0" ALT="' . $Language->getText('global', 'btn_delete') . '"></A>';
             } else {
                 $html_delete = '-';
             }
             $out .= sprintf($fmt, util_get_alt_row_color($i), '<a href="' . $href . '">' . $hp->purify(db_result($result, $i, 'filename'), CODENDI_PURIFIER_CONVERT_HTML) . '</a>', $hp->purify(SimpleSanitizer::unsanitize(db_result($result, $i, 'description')), CODENDI_PURIFIER_BASIC, $group_id), intval(db_result($result, $i, 'filesize') / 1024), util_user_link(db_result($result, $i, 'user_name')), format_date($GLOBALS['Language']->getText('system', 'datefmt'), db_result($result, $i, 'adddate')), $html_delete);
         }
     }
     // for
     // final touch...
     $out .= $ascii ? "" . $GLOBALS['sys_lf'] . "" : "</TABLE>";
     return $out;
 }
Пример #25
0
require_once 'common/mail/Mail.class.php';
require_once 'common/event/EventManager.class.php';
$em =& EventManager::instance();
$em->processEvent('before_change_email-confirm', array());
$request =& HTTPRequest::instance();
$confirm_hash = substr(md5($GLOBALS['session_hash'] . time()), 0, 16);
$res_user = db_query("SELECT * FROM user WHERE user_id=" . user_getid());
if (db_numrows($res_user) < 1) {
    exit_error("Invalid User", "That user does not exist.");
}
$row_user = db_fetch_array($res_user);
$mail_is_sent = false;
$form_newemail = $request->get('form_newemail');
if (validate_email($form_newemail)) {
    db_query("UPDATE user SET confirm_hash='" . $confirm_hash . "',email_new='" . db_es($form_newemail) . "' " . "WHERE user_id=" . $row_user['user_id']);
    $message = stripcslashes($Language->getText('account_change_email-confirm', 'message', array($GLOBALS['sys_name'], get_server_url() . "/account/change_email-complete.php?confirm_hash=" . $confirm_hash)));
    $mail = new Mail();
    $mail->setTo($form_newemail, true);
    $mail->setSubject($GLOBALS['sys_name'] . ': ' . $Language->getText('account_change_email-confirm', 'title'));
    $mail->setBody($message);
    $mail->setFrom($GLOBALS['sys_noreply']);
    $mail_is_sent = $mail->send();
    if (!$mail_is_sent) {
        $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('global', 'mail_failed', array($GLOBALS['sys_email_admin'])));
    }
} else {
    $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('include_utils', 'invalid_email'));
}
site_header(array('title' => $Language->getText('account_change_email-confirm', 'title')));
?>
Пример #26
0
function frs_display_release_form($is_update, &$release, $group_id, $title, $url)
{
    global $frspf, $frsrf, $frsff;
    $hp =& Codendi_HTMLPurifier::instance();
    if (is_array($release)) {
        if (isset($release['date'])) {
            $release_date = $release['date'];
        }
        $release = new FRSRelease($release);
    }
    if ($is_update) {
        $files = $release->getFiles();
        if (count($files) > 0) {
            for ($i = 0; $i < count($files); $i++) {
                if (!$frsff->compareMd5Checksums($files[$i]->getComputedMd5(), $files[$i]->getReferenceMd5())) {
                    $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('file_admin_editreleases', 'md5_fail', array(basename($files[$i]->getFileName()), $files[$i]->getComputedMd5())));
                }
            }
        }
    }
    file_utils_admin_header(array('title' => $GLOBALS['Language']->getText('file_admin_editreleases', 'release_new_file_version'), 'help' => 'frs.html#delivery-manager-administration'));
    echo '<H3>' . $hp->purify($title, CODENDI_PURIFIER_CONVERT_HTML) . '</H3>';
    $sql = "SELECT * FROM frs_processor WHERE (group_id = 100 OR group_id = " . db_ei($group_id) . ") ORDER BY rank";
    $result = db_query($sql);
    $processor_id = util_result_column_to_array($result, 0);
    $processor_name = util_result_column_to_array($result, 1);
    foreach ($processor_name as $key => $value) {
        $processor_name[$key] = $hp->purify($value, CODENDI_PURIFIER_JS_QUOTE);
    }
    $sql = "SELECT * FROM frs_filetype ORDER BY type_id";
    $result1 = db_query($sql);
    $type_id = util_result_column_to_array($result1, 0);
    $type_name = util_result_column_to_array($result1, 1);
    $url_news = get_server_url() . "/file/showfiles.php?group_id=" . $group_id;
    echo '<script type="text/javascript">';
    echo "var processor_id = ['" . implode("', '", $processor_id) . "'];";
    echo "var processor_name = ['" . implode("', '", $processor_name) . "'];";
    echo "var type_id = ['" . implode("', '", $type_id) . "'];";
    echo "var type_name = ['" . implode("', '", $type_name) . "'];";
    echo "var group_id = " . $group_id . ";";
    echo "var relname = '" . $GLOBALS['Language']->getText('file_admin_editreleases', 'relname') . "';";
    echo "var choose = '" . $GLOBALS['Language']->getText('file_file_utils', 'must_choose_one') . "';";
    echo "var browse = '" . $GLOBALS['Language']->getText('file_admin_editreleases', 'browse') . "';";
    echo "var local_file = '" . $GLOBALS['Language']->getText('file_admin_editreleases', 'local_file') . "';";
    echo "var scp_ftp_files = '" . $GLOBALS['Language']->getText('file_admin_editreleases', 'scp_ftp_files') . "';";
    echo "var upload_text = '" . $GLOBALS['Language']->getText('file_admin_editreleases', 'upload') . "';";
    echo "var add_file_text = '" . $GLOBALS['Language']->getText('file_admin_editreleases', 'add_file') . "';";
    echo "var add_change_log_text = '" . $GLOBALS['Language']->getText('file_admin_editreleases', 'add_change_log') . "';";
    echo "var view_change_text = '" . $GLOBALS['Language']->getText('file_admin_editreleases', 'view_change') . "';";
    echo "var refresh_files_list = '" . $GLOBALS['Language']->getText('file_admin_editreleases', 'refresh_file_list') . "';";
    echo "var release_mode = '" . ($is_update ? 'edition' : 'creation') . "';";
    if ($is_update) {
        $pm = PermissionsManager::instance();
        $dar = $pm->getAuthorizedUgroups($release->getReleaseID(), FRSRelease::PERM_READ);
        $ugroups_name = array();
        foreach ($dar as $row) {
            $ugroups_name[] = util_translate_name_ugroup($row['name']);
        }
        echo "var ugroups_name = '" . implode(", ", $ugroups_name) . "';";
        echo "var default_permissions_text = '" . $GLOBALS['Language']->getText('file_admin_editreleases', 'release_perm') . "';";
    } else {
        echo "var default_permissions_text = '" . $GLOBALS['Language']->getText('file_admin_editreleases', 'default_permissions') . "';";
    }
    echo '</script>';
    //set variables for news template
    $relname = $GLOBALS['Language']->getText('file_admin_editreleases', 'relname');
    if (!$is_update) {
        echo '<p>' . $GLOBALS['Language']->getText('file_admin_editreleases', 'contain_multiple_files') . '</p>';
    }
    ?>
    
    <FORM id="frs_form" NAME="frsRelease" ENCTYPE="multipart/form-data" METHOD="POST" ACTION="<?php 
    echo $url;
    ?>
" CLASS="form-inline">
        <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="<? echo $GLOBALS['sys_max_size_upload']; ?>">
        <input type="hidden" name="postReceived" value="" />
        <?php 
    if ($release->getReleaseId()) {
        echo '<input type="hidden" id="release_id" name="release[release_id]" value="' . $release->getReleaseId() . '" />';
    }
    ?>
        <TABLE BORDER="0" width="100%">
        <TR><TD><FIELDSET><LEGEND><?php 
    echo $GLOBALS['Language']->getText('file_admin_editreleases', 'fieldset_properties');
    ?>
</LEGEND>
        <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="2">
            <TR>
                <TD>
                    <B><?php 
    echo $GLOBALS['Language']->getText('file_admin_editpackages', 'p_name');
    ?>
:</B>
                </TD>
                <TD>
    <?php 
    $res =& $frspf->getFRSPackagesFromDb($group_id);
    $rows = count($res);
    if (!$res || $rows < 1) {
        echo '<p class="highlight">' . $GLOBALS['Language']->getText('file_admin_qrs', 'no_p_available') . '</p>';
    } else {
        echo '<SELECT NAME="release[package_id]" id="package_id">';
        for ($i = 0; $i < $rows; $i++) {
            echo '<OPTION VALUE="' . $res[$i]->getPackageID() . '"';
            if ($res[$i]->getPackageID() == $release->getPackageId()) {
                echo ' selected';
            }
            echo '>' . $hp->purify(util_unconvert_htmlspecialchars($res[$i]->getName()), CODENDI_PURIFIER_CONVERT_HTML) . '</OPTION>';
        }
        echo '</SELECT>';
    }
    ?>
                </TD><td></td>
                <TD>
                    <B><?php 
    echo $GLOBALS['Language']->getText('file_admin_editreleases', 'release_name');
    ?>
: <span class="highlight"><strong>*</strong></span></B>
                </TD>
                <TD>
                    <INPUT TYPE="TEXT" id="release_name" name="release[name]" onBlur="update_news()" value="<?php 
    echo $hp->purify($release->getName());
    ?>
">
                </TD>
            </TR>
            <TR>
                <TD>
                    <B><?php 
    echo $GLOBALS['Language']->getText('file_admin_editreleases', 'release_date');
    ?>
:</B>
                </TD>
                <TD>
                <?php 
    echo $GLOBALS['HTML']->getDatePicker('release_date', 'release[date]', isset($release_date) ? $hp->purify($release_date) : format_date('Y-m-d', $release->getReleaseDate()));
    ?>
                </TD>
                <td></td>
                <TD>
                    <B><?php 
    echo $GLOBALS['Language']->getText('global', 'status');
    ?>
:</B>
                </TD>
                <TD>
                    <?php 
    print frs_show_status_popup($name = 'release[status_id]', $release->getStatusID()) . "<br>";
    ?>
                </TD>
            </TR></TABLE></FIELDSET>
        </TD></TR>
        <TR><TD><FIELDSET><LEGEND><?php 
    echo $GLOBALS['Language']->getText('file_admin_editreleases', 'fieldset_uploaded_files');
    ?>
</LEGEND>
    <?php 
    $titles = array();
    $titles[] = $is_update ? $GLOBALS['Language']->getText('file_admin_editreleases', 'delete_col') : '';
    $titles[] = $GLOBALS['Language']->getText('file_admin_editreleases', 'filename');
    $titles[] = $GLOBALS['Language']->getText('file_admin_editreleases', 'processor');
    $titles[] = $GLOBALS['Language']->getText('file_admin_editreleases', 'file_type');
    $titles[] = $GLOBALS['Language']->getText('file_admin_editreleases', 'md5sum');
    $titles[] = $GLOBALS['Language']->getText('file_admin_editreleases', 'comment');
    $titles[] = $GLOBALS['Language']->getText('file_admin_editreleases', 'user');
    if ($is_update) {
        $titles[] = $GLOBALS['Language']->getText('file_admin_editreleasepermissions', 'release');
        $titles[] = $GLOBALS['Language']->getText('file_admin_editreleases', 'release_date');
    }
    echo html_build_list_table_top($titles, false, false, false, 'files');
    ?>
            <tbody id="files_body">
    
    <?php 
    $files =& $release->getFiles();
    for ($i = 0; $i < count($files); $i++) {
        $fname = $files[$i]->getFileName();
        $list = split('/', $fname);
        $fname = $list[sizeof($list) - 1];
        $user_id = $files[$i]->getUserID();
        $userName = isset($user_id) ? UserManager::instance()->getUserById($files[$i]->getUserID())->getRealName() : "";
        echo '<TR>';
        echo '<TD><INPUT TYPE="CHECKBOX" NAME="release_files_to_delete[]" VALUE="' . $files[$i]->getFileID() . '"</TD>';
        echo '<TD>' . $hp->purify($fname, CODENDI_PURIFIER_CONVERT_HTML) . '<INPUT TYPE="HIDDEN" NAME="release_files[]" VALUE="' . $files[$i]->getFileID() . '"></TD>';
        echo '<TD>' . frs_show_processor_popup($group_id, $name = 'release_file_processor[]', $files[$i]->getProcessorID()) . '</TD>';
        echo '<TD>' . frs_show_filetype_popup($name = 'release_file_type[]', $files[$i]->getTypeID()) . '</TD>';
        //In case of difference between the inserted md5 and the computed one
        //we dispaly an editable text field to let the user insert the right value
        //to avoid the error message next time
        $value = 'value = "' . $files[$i]->getReferenceMd5() . '"';
        if ($frsff->compareMd5Checksums($files[$i]->getComputedMd5(), $files[$i]->getReferenceMd5())) {
            $value = 'value = "' . $files[$i]->getComputedMd5() . '" readonly="true"';
        }
        echo '<TD><INPUT TYPE="TEXT" NAME="release_reference_md5[]" ' . $value . ' SIZE="36" ></TD>';
        $comment = $files[$i]->getComment();
        echo '<TD><textarea NAME="release_comment[]" cols="20", rows="1" >' . $comment . '</textarea></TD>';
        echo '<TD><INPUT TYPE="TEXT" NAME="user" value = "' . $userName . '" readonly="true"></TD>';
        echo '<TD>' . frs_show_release_popup2($group_id, $name = 'new_release_id[]', $files[$i]->getReleaseID()) . '</TD>';
        echo '<TD><INPUT TYPE="TEXT" NAME="release_time[]" VALUE="' . format_date('Y-m-d', $files[$i]->getReleaseTime()) . '" SIZE="10" MAXLENGTH="10"></TD></TR>';
    }
    echo '<INPUT TYPE="HIDDEN" id="nb_files" NAME="nb_files" VALUE="' . count($files) . '">';
    ?>
                        
                        <tr id="row_0">
                            <td></td>
                            <td>
                                <input type="hidden" name="js" value="no_js"/>
                                <select name="ftp_file[]" id="ftp_file_0">
                                    <option value="-1"><?php 
    echo $GLOBALS['Language']->getText('file_file_utils', 'must_choose_one');
    ?>
</option>
    <?php 
    //iterate and show the files in the upload directory
    $file_list = $frsff->getUploadedFileNames($release->getProject());
    foreach ($file_list as $file) {
        echo '<option value="' . $file . '">' . $hp->purify($file, CODENDI_PURIFIER_CONVERT_HTML) . '</option>';
    }
    echo '<script type="text/javascript">';
    echo "var available_ftp_files = ['" . implode("', '", $file_list) . "'];";
    echo '</script>';
    ?>
                                </select>
    
                                <span id="or">or</span>
                                <input type="file" name="file[]" id="file_0" />
                            </td>
                            <td>
                                <?php 
    print frs_show_processor_popup($group_id, $name = 'file_processor');
    ?>
                            </td>
                            <td>
                                <?php 
    print frs_show_filetype_popup($name = 'file_type');
    ?>
                            </td>
                            <td>
                                <input name="reference_md5" value="" size="36" type="TEXT">
                            </td>
                        </tr>
                    </tbody>
                </table>
                <?php 
    echo '<span class="small" style="color:#666"><i>' . $GLOBALS['Language']->getText('file_admin_editreleases', 'upload_file_msg', formatByteToMb($GLOBALS['sys_max_size_upload'])) . '</i> </span>';
    echo '<div id=\'files_help\'><span class="smaller">';
    include $GLOBALS['Language']->getContent('file/qrs_attach_file');
    echo '</span></div>';
    ?>
            </FIELDSET>
            </TD></TR>
            <TR><TD><FIELDSET><LEGEND><?php 
    echo $GLOBALS['Language']->getText('file_admin_editreleases', 'fieldset_notes');
    ?>
</LEGEND>
            <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="2" WIDTH="100%">
            <TR id="notes_title">
                <TD VALIGN="TOP" width="10%">
                    <span id="release_notes"><B><?php 
    echo $GLOBALS['Language']->getText('file_admin_editreleases', 'release_notes');
    ?>
:  </B></span>
                </TD>
            </TR>
            <TR id="upload_notes">
                <TD>
                    <input id="uploaded_notes" type="file" name="uploaded_release_notes"  size="30">
                </TD>
            </TR>
            <TR id="release_notes_area">
                <TD width="100%">
                    <TEXTAREA NAME="release[release_notes]" rows="7" cols="70"><?php 
    echo $hp->purify($release->getNotes(), CODENDI_PURIFIER_CONVERT_HTML);
    ?>
</TEXTAREA>
                </TD>
            </TR>
            <TR id="change_log_title">
                <TD VALIGN="TOP" width="10%">
                    <span id="change_log"><B><?php 
    echo $GLOBALS['Language']->getText('file_admin_editreleases', 'change_log');
    ?>
:  </B></span>
                </TD>
            </TR>
            <TR id="upload_change_log">
                <TD>
                    <input type="file" id="uploaded_change_log" name="uploaded_change_log"  size="30">
                </TD>
            </TR>
            <TR id="change_log_area">
                <TD width="40%">
                    <TEXTAREA ID="text_area_change_log" NAME="release[change_log]" ROWS="7" COLS="70"><?php 
    echo $hp->purify($release->getChanges(), CODENDI_PURIFIER_CONVERT_HTML);
    ?>
</TEXTAREA>
                </TD>
            </TR>
            </TABLE></FIELDSET>
            </TD></TR>
            <TR>
                <TD>
                    <FIELDSET><LEGEND><?php 
    echo $GLOBALS['Language']->getText('file_admin_editreleases', 'fieldset_permissions');
    ?>
</LEGEND>
                        <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="2">
    
                            <TR id="permissions">
                                <TD>
                                    <DIV id="permissions_list">
                                        <?php 
    if ($is_update) {
        permission_display_selection_frs("RELEASE_READ", $release->getReleaseID(), $group_id);
    } else {
        permission_display_selection_frs("PACKAGE_READ", $release->getPackageID(), $group_id);
    }
    ?>
                                    </DIV>
                                </TD>
                            </TR>
                        </TABLE>
                    </FIELDSET>
                </TD>
            </TR> 
            <?php 
    if (user_ismember($group_id, 'A') || user_ismember($group_id, 'N2') || user_ismember($group_id, 'N1')) {
        echo '
            <TR><TD><FIELDSET><LEGEND>' . $GLOBALS['Language']->getText('file_admin_editreleases', 'fieldset_news') . '</LEGEND>
                <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="2">
                    <TR>
                        <TD VALIGN="TOP">
                            <B> ' . $GLOBALS['Language']->getText('file_admin_editreleases', 'submit_news') . ' :</B>
                        </TD>
                        <TD>
                            <INPUT ID="submit_news" TYPE="CHECKBOX" NAME="release_submit_news" VALUE="1">
                            
                        </TD>	
                    </TR>
                    <TR id="tr_subject">
                        <TD VALIGN="TOP" ALIGN="RIGHT">
                            <B> ' . $GLOBALS['Language']->getText('file_admin_editreleases', 'subject') . ' :</B>
                        </TD>
                        <TD>
                            <INPUT TYPE="TEXT" ID="release_news_subject" NAME="release_news_subject" VALUE=" ' . $GLOBALS['Language']->getText('file_admin_editreleases', 'file_news_subject', $relname) . '" SIZE="40" MAXLENGTH="60">
                        </TD>
                    </TR>	
                    <TR id="tr_details">
                        <TD VALIGN="TOP" ALIGN="RIGHT">
                            <B> ' . $GLOBALS['Language']->getText('file_admin_editreleases', 'details') . ' :</B>
                        </TD>
                        <TD>
                            <TEXTAREA ID="release_news_details" NAME="release_news_details" ROWS="7" COLS="50">' . $GLOBALS['Language']->getText('file_admin_editreleases', 'file_news_details', array($relname, $url_news)) . ' </TEXTAREA>
                        </TD>
                    </TR>
                    <TR id="tr_public">
                        <TD ROWSPAN=2 VALIGN="TOP" ALIGN="RIGHT">
                            <B> ' . $GLOBALS['Language']->getText('news_submit', 'news_privacy') . ' :</B>
                        </TD>
                        <TD>
                            <INPUT TYPE="RADIO" ID="publicnews" NAME="private_news" VALUE="0" CHECKED>' . $GLOBALS['Language']->getText('news_submit', 'public_news') . '
                        </TD>
                    </TR > 
                    <TR id="tr_private">
                        <TD>
                            <INPUT TYPE="RADIO" ID="privatenews" NAME="private_news" VALUE="1">' . $GLOBALS['Language']->getText('news_submit', 'private_news') . '
                        </TD>
                    </TR></DIV>
                </TABLE></FIELDSET>
            </TD></TR>';
    }
    $fmmf = new FileModuleMonitorFactory();
    $count = count($fmmf->getFilesModuleMonitorFromDb($release->getPackageId()));
    if ($count > 0) {
        echo '<TR><TD><FIELDSET><LEGEND>' . $GLOBALS['Language']->getText('file_admin_editreleases', 'fieldset_notification') . '</LEGEND>';
        echo '<TABLE BORDER="0" CELLPADDING="2" CELLSPACING="2">';
        echo '<TR><TD>' . $GLOBALS['Language']->getText('file_admin_editreleases', 'users_monitor', $count) . '</TD></TR>';
        echo '<TR><TD><B>' . $GLOBALS['Language']->getText('file_admin_editreleases', 'mail_file_rel_notice') . '</B><INPUT TYPE="CHECKBOX" NAME="notification" VALUE="1" CHECKED>';
        echo '</TD></TR>';
        echo '</TABLE></FIELDSET></TD></TR>';
    }
    ?>
            
            <TR>
                <TD ALIGN="CENTER">
                    
                    <INPUT TYPE="HIDDEN" NAME="create" VALUE="bla">
                    <INPUT TYPE="SUBMIT" ID="create_release"  VALUE="<?php 
    echo $is_update ? $GLOBALS['Language']->getText('file_admin_editreleases', 'edit_release') : $GLOBALS['Language']->getText('file_admin_qrs', 'release_file');
    ?>
">
                    <input type="submit" ID="cancel_release" name="cancel" value="<?php 
    echo $GLOBALS['Language']->getText('global', 'btn_cancel');
    ?>
" />
                </TD>
            </TR>
        </TABLE>
    </FORM>
    
    <?php 
    file_utils_footer(array());
}
Пример #27
0
function session_make_url($loc)
{
    return get_server_url() . $loc;
}
 /**
  * @return string html call to action button to include in an html mail
  */
 private function getUnsubscribeLink()
 {
     $link = get_server_url() . '/plugins/tracker/?aid=' . (int) $this->getArtifact()->getId() . '&func=manage-subscription';
     return '<a href="' . $link . '" target="_blank">' . $GLOBALS['Language']->getText('plugin_tracker_artifact', 'mail_unsubscribe') . '</a>';
 }
Пример #29
0
 /**
  *	create - create a new item in the database.
  *
  *	@para	string	Filename of the item.
  *	@param	string	Item filetype.
  *	@param	string	Item filesize.
  *	@param	binary	Binary item data.
  *	@param	string	Item description.
  *  @return id on success / false on failure.
  */
 function create($filename, $filetype, $filesize, $bin_data, $description = false, &$changes)
 {
     global $Language;
     if (!$description) {
         $description = $Language->getText('global', 'none');
     }
     $old_value = $this->Artifact->getAttachedFileNames();
     // Some browsers don't supply mime type if they don't know it
     if (!$filetype) {
         // Let's be on safe side?
         $filetype = 'application/octet-stream';
     }
     //
     //	data validation
     //
     if (!$filename || !$filetype || !$filesize || !$bin_data) {
         $GLOBALS['Response']->addFeedback('error', '<P>|' . $filename . '|' . $filetype . '|' . $filesize . '|' . $bin_data . '|');
         $this->setError('ArtifactFile: ' . $Language->getText('tracker_common_file', 'name_requ'));
         return false;
     }
     if (user_isloggedin()) {
         $userid = user_getid();
     } else {
         $userid = 100;
     }
     $res = db_query("INSERT INTO artifact_file\n\t\t\t(artifact_id,description,bin_data,filename,filesize,filetype,adddate,submitted_by)\n\t\t\tVALUES \n\t\t\t('" . db_ei($this->Artifact->getID()) . "','" . db_es($description) . "','" . db_es($bin_data) . "','" . db_es($filename) . "',\n\t\t\t'" . db_ei($filesize) . "','" . db_es($filetype) . "','" . time() . "','" . db_ei($userid) . "')");
     $id = db_insertid($res, 'artifact_file', 'id');
     if (!$res || !$id) {
         $this->setError('ArtifactFile: ' . db_error());
         return false;
     } else {
         $this->clearError();
         $changes['attach']['description'] = $description;
         $changes['attach']['name'] = $filename;
         $changes['attach']['size'] = $filesize;
         if ($old_value == '') {
             $new_value = $filename;
         } else {
             $new_value = $old_value . "," . $filename;
         }
         $this->Artifact->addHistory('attachment', $old_value, $new_value);
         $changes['attach']['href'] = get_server_url() . "/tracker/download.php?artifact_id=" . $this->Artifact->getID() . "&id={$id}";
         return $id;
     }
 }
Пример #30
0
                             <td align="center" valign="top">
                                    <!-- // Begin Template Footer \\ -->
                                 <table border="0" cellpadding="10" cellspacing="0" width="750" id="templateFooter">
                                     <tr>
                                         <td valign="top" class="footerContent">
                                            
                                                <!-- // Begin Module: Standard Footer \\ -->
                                                <table border="0" cellpadding="10" cellspacing="0" width="100%">
                                                    <tr>
                                                        <td colspan="2" valign="middle" id="social">
                                                            <div>
                                                                <?php 
echo !empty($additional_footer_link) ? '&nbsp;' . $additional_footer_link . '&nbsp; |' : '';
?>
                                                                &nbsp;<a href="<?php 
echo get_server_url();
?>
/account/preferences.php" target="_blank"><?php 
echo $txt_can_update_prefs;
?>
</a>&nbsp;
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>
                                                <!-- // End Module: Standard Footer \\ -->
                                            </td>
                                        </tr>
                                    </table>
                                    <!-- // End Template Footer \\ -->
                                </td>