private function addLogoInAttachment(Codendi_Mail $mail) { $logo_retriever = new LogoRetriever(); $cid_logo = ''; $path_logo = $logo_retriever->getPath(); if ($path_logo) { $id_attachment = 'logo'; $mail->addInlineAttachment(file_get_contents($path_logo), $logo_retriever->getMimetype(), $id_attachment); $cid_logo = 'cid:' . $id_attachment; } return $cid_logo; }
} $renderer = TemplateRendererFactory::build()->getRenderer(ForgeConfig::get('codendi_dir') . '/src/templates/account/'); $renderer->renderToPage($template, $presenter); } // ###### first check for valid login, if so, congratulate $request =& HTTPRequest::instance(); $hp =& Codendi_HTMLPurifier::instance(); $errors = array(); if ($request->isPost() && $request->exist('Register')) { $page = $request->get('page'); $displayed_image = true; $image_url = ''; $email_presenter = ''; $mail_confirm_code_generator = new MailConfirmationCodeGenerator(UserManager::instance(), new RandomNumberGenerator()); $mail_confirm_code = $mail_confirm_code_generator->getConfirmationCode(); $logo_retriever = new LogoRetriever(); if ($new_userid = register_valid($mail_confirm_code, $errors)) { $confirmation_register = true; $user_name = user_getname($new_userid); $content = ''; $admin_creation = false; if ($page == 'admin_creation') { $admin_creation = true; if ($request->get('form_send_email')) { //send an email to the user with th login and password $from = $GLOBALS['sys_noreply']; $to = $request->get('form_email'); $login = $hp->purify($request->get('form_loginname')); $password = $hp->purify($request->get('form_pw')); if (!send_admin_new_user_email($to, $login, $password)) { $GLOBALS['Response']->addFeedback(Feedback::ERROR, $GLOBALS['Language']->getText('global', 'mail_failed', array($GLOBALS['sys_email_admin'])));
public function itDoesNotFoundUnavailableLogo() { ForgeConfig::set('sys_themedefault', 'notfound'); $logo_retriever = new LogoRetriever(); $this->assertFalse($logo_retriever->getPath()); }