Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Thu, Sep 18, 4:09 PM

in-portal

Index: branches/unlabeled/unlabeled-1.14.2/kernel/units/admin/admin_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.14.2/kernel/units/admin/admin_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.14.2/kernel/units/admin/admin_config.php (revision 5434)
@@ -0,0 +1,189 @@
+<?php
+
+ $config = Array(
+ 'Prefix' => 'adm',
+ 'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'AdminTagProcessor', 'file' => 'admin_tag_processor.php', 'build_event' => 'OnBuild'),
+
+
+ 'TitlePresets' => Array(
+ 'tree_root' => Array('format' => '!la_section_overview!'),
+
+ 'tree_reports' => Array('format' => '!la_section_overview!'),
+
+ 'tree_system' => Array('format' => '!la_section_overview!'),
+
+ 'tree_tools' => Array('format' => '!la_section_overview!'),
+
+ 'no_permissions' => Array('format' => '!la_title_NoPermissions!'),
+ ),
+
+ 'Sections' => Array(
+ 'in-portal:root' => Array(
+ 'parent' => null,
+ 'icon' => 'site',
+ 'label' => $this->Application->ConfigValue('Site_Name'),
+ 'url' => Array('t' => 'sections_list', 'pass' => 'm', 'pass_section' => true, 'no_amp' => 1),
+ 'permissions' => Array('advanced:admin_login', 'advanced:front_login'),
+ 'priority' => 0,
+ 'type' => stTREE,
+ ),
+
+ // "Summary & Logs" section
+ 'in-portal:reports' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'summary_logs',
+ 'label' => 'la_tab_Reports',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:log_summary' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'summary',
+ 'label' => 'la_tab_Summary',
+ 'url' => Array('index_file' => 'logs/summary.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:searchlog' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'search_log',
+ 'label' => 'la_tab_SearchLog',
+ 'url' => Array('index_file' => 'logs/searchlog.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:sessionlog' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'sessions_log',
+ 'label' => 'la_tab_SessionLog',
+ 'url' => Array('index_file' => 'logs/session_list.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:emaillog' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'email_log',
+ 'label' => 'la_tab_EmailLog',
+ 'url' => Array('index_file' => 'logs/email_log.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:visits' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'visits',
+ 'label' => 'la_tab_Visits',
+ 'url' => Array('t' => 'visits/visits_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ // "Configuration" section
+ 'in-portal:system' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'conf',
+ 'label' => 'la_tab_Sys_Config',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:configure_general' => Array(
+ 'parent' => 'in-portal:system',
+ 'icon' => 'conf_general',
+ 'label' => 'la_tab_General',
+ 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ // "Tools" section
+ 'in-portal:tools' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'tools',
+ 'label' => 'la_tab_Tools',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:backup' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_backup',
+ 'label' => 'la_tab_Backup',
+ 'url' => Array('index_file' => 'backup/backup1.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:restore' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_restore',
+ 'label' => 'la_tab_Restore',
+ 'url' => Array('index_file' => 'backup/restore1.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:main_import' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_import',
+ 'label' => 'la_tab_ImportData',
+ 'url' => Array('index_file' => 'import/step1.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:sql_query' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_import',
+ 'label' => 'la_tab_QueryDB',
+ 'url' => Array('index_file' => 'tools/sql_query.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:server_info' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'server_info',
+ 'label' => 'la_tab_ServerInfo',
+ 'url' => Array('index_file' => 'tools/server_info.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ // "Help" section
+ 'in-portal:help' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'help',
+ 'label' => 'la_tab_Help',
+ 'url' => Array('index_file' => 'help/manual.pdf', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 7,
+ 'type' => stTREE,
+ ),
+ ),
+
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.14.2/kernel/units/admin/admin_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.14
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.14.2/admin/email/do_send.php
===================================================================
--- branches/unlabeled/unlabeled-1.14.2/admin/email/do_send.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.14.2/admin/email/do_send.php (revision 5434)
@@ -0,0 +1,266 @@
+<?php
+##############################################################
+##In-portal ##
+##############################################################
+## In-portal ##
+## Intechnic Corporation ##
+## All Rights Reserved, 1998-2002 ##
+## ##
+## No portion of this code may be copied, reproduced or ##
+## otherwise redistributed without proper written ##
+## consent of Intechnic Corporation. Violation will ##
+## result in revocation of the license and support ##
+## privileges along maximum prosecution allowed by law. ##
+##############################################################
+
+// new startup: begin
+define('REL_PATH', 'admin/email');
+$relation_level = count( explode('/', REL_PATH) );
+define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
+require_once FULL_PATH.'/kernel/startup.php';
+// new startup: end
+
+$pathtolocal = $pathtoroot."kernel/";
+require_once ($pathtoroot.$admin."/include/elements.php");
+//require_once ($pathtoroot."kernel/admin/include/navmenu.php");
+require_once ($pathtolocal."admin/include/navmenu.php");
+require_once($pathtoroot.$admin."/browse/toolbar.php");
+
+//Set Section
+$section = 'in-portal:sendmail';
+
+//Set Environment Variable
+$envar = "env=" . BuildEnv();
+
+$State = $_POST["EmailState"];
+if(!strlen($State))
+{
+ $State = $_GET["EmailState"];
+}
+
+$ado = &GetADODBConnection();
+$table = "ses_".$objSession->GetSessionKey()."_sendmail";
+$MessagesPerPage =2;
+
+$SendQueue = new clsEmailQueue($table,$MessagesPerPage);
+
+$FromUser = $objUsers->GetItem($objSession->Get("PortalUserId"));
+
+$FromAddr = $FromUser->Get("Email");
+$FromName = $FromUser->Get("FirstName")." ".$FromUser->Get("LastName");
+
+if(!strlen(trim($FromAddr)))
+{
+ $FromAddr = $objConfig->Get("Smtp_AdminMailFrom");
+}
+
+if(!strlen(trim($FromName)))
+{
+ $FromName = strip_tags( $objConfig->Get('Site_Name') );
+}
+
+$TargetURL = $_SERVER["PHP_SELF"]."?".$envar.'&destform=popup';
+$CancelURL = $TargetURL."&EmailState=email_user_cancel";
+
+ function getEmailFooter($is_html = true)
+ {
+ static $footer = Array('html' => null, 'plain' => null);
+
+ $footer_body =& $footer[$is_html ? 'html' : 'plain'];
+ if (is_null($footer_body)) {
+ $application =& kApplication::Instance();
+ $email_object =& $application->recallObject('kEmailMessage');
+ $email_object->Clear();
+
+ $sql = 'SELECT em.Template
+ FROM '.TABLE_PREFIX.'EmailMessage em
+ LEFT JOIN '.TABLE_PREFIX.'Events e ON e.EventId = em.EventId
+ WHERE em.LanguageId = '.$application->GetVar('m_lang').' AND e.Event = "COMMON.FOOTER"';
+ $footer_body = explode("\n\n", $application->Conn->GetOne($sql));
+ $footer_body = "\r\n".($is_html ? $footer_body[1] : $email_object->convertHTMLtoPlain($footer_body[1]));
+ }
+ return $footer_body;
+ }
+
+
+/*Initialize page*/
+switch($State)
+{
+ case "email_single_send": /*single user send */
+ $PageTitle = admin_language("la_Title_SendInit");
+ $Subject = $_POST["subject"];
+ $Html = $_POST["messageHTML"].getEmailFooter(true);
+ $Text = strip_tags($_POST["messageTEXT"]).getEmailFooter(false);
+
+ if(is_array($_FILES))
+ {
+ $attatch = $_FILES["attatchment"];
+ if(strlen($attatch["name"]) >0 && $attatch["size"]>0)
+ {
+ $FileName = $attatch["name"];
+ $FileLoc = $attatch["tmp_name"];
+ }
+ else
+ {
+ $FileName = NULL;
+ $FileLoc = NULL;
+ }
+ }
+ else
+ {
+ $FileName = NULL;
+ $FileLoc = NULL;
+ }
+ $charset = "";
+ $TargetURL .= "&EmailState=email_send_complete";
+ break;
+ case "email_multi_send": /*Init multiuser send*/
+ $UserList = explode(",",$_POST["sendaddrs"]);
+ //echo $_POST["sendaddrs"]."<br>\n";
+
+ $Subject = $_POST["subject"];
+ $Html = $_POST["messageHTML"].getEmailFooter(true);
+ $Text = strip_tags($_POST["messageTEXT"]).getEmailFooter(false);
+
+ if(is_array($_FILES))
+ {
+ $attatch = $_FILES["attatchment"];
+ if(strlen($attatch["name"]) >0 && $attatch["size"]>0)
+ {
+ $FileName = $attatch["name"];
+ $FileLoc = $attatch["tmp_name"];
+ }
+ else
+ {
+ $FileName = NULL;
+ $FileLoc = NULL;
+ }
+ }
+ else
+ {
+ $FileName = NULL;
+ $FileLoc = NULL;
+ }
+
+ $charset = "";
+ $PageTitle = admin_language("la_Title_SendMailInit");
+ $TargetURL .="&EmailState=email_send_progress&Start=0&Total=".count($UserList);
+ break;
+ case "email_send_progress":
+ $total = $_GET["Total"];
+ $start = $_GET["Start"];
+ if($start < $total)
+ {
+ $pct = (int)(($start/$total)*100);
+ $NewStart = $start+$MessagesPerPage;
+ $TargetURL .= "&EmailState=email_send_progress&Start=$NewStart&Total=$total";
+ $PageTitle = admin_language("la_Title_SendMailProgress")." - ".$pct."% ".admin_language("la_Text_Complete");
+ }
+ else
+ {
+ $PageTitle = admin_language("la_Title_SendMailProgress");
+ $TargetURL .= "&EmailState=email_send_complete";
+ }
+ break;
+ case "email_send_complete":
+ $PageTitle = admin_language("la_Title_SendMailComplete");
+ $TargetURL="";
+ break;
+ case "email_user_cancel":
+ $PageTitle = admin_language("la_Title_SendMailCancel");
+ $TargetURL = "";
+ break;
+
+}
+
+ int_header(NULL,NULL,admin_language("la_Title_PleaseWait"));
+ echo "\n";
+
+/*do page functions */
+// echo "Current State:". $State."<br>\n";
+
+echo "<TABLE border=0 width=\"100%\" height=\"90%\"><TR><TD valign=\"top\" align=\"middle\">";
+switch($State)
+{
+case "email_single_send": /*single user send */
+ $PageTitle = admin_language($Pagetitle);
+ $ToAddr = $_POST["sendaddrs"];
+
+ $SendQueue->SendMail($FromAddr,$FromName,$ToAddr,"",$Subject,$Text,$Html,$charset, "",$FileName,$FileLoc,0, NULL);
+ $o = "<TABLE CLASS=\"tableborder_full\" width=\"75%\">";
+ $o .= int_subsection_title_ret($PageTitle);
+ $o .= "<TD COLSPAN=2>".admin_language("la_prompt_EmailInitMessage")."</TD></TR>";
+ $o .= "<TD ALIGN=\"middle\" COLSPAN=2></TD></TR>";
+ $o .= "</TABLE><input type=button CLASS=\"button\" VALUE=\"".admin_language("la_Cancel")."\" ONCLICK=\"document.location='".$CancelURL."';\">";
+ echo $o."\n";
+ break;
+ case "email_multi_send": /*Init multiuser send*/
+ /*Create storage Table for Queue */
+ $o = "<TABLE CLASS=\"tableborder_full\" width=\"75%\">";
+ $o .= int_subsection_title_ret($PageTitle);
+ $o .= "<tr><TD COLSPAN=2>".admin_language("la_prompt_EmailInitMessage")."</TD></TR>";
+ $o .= "<TD ALIGN=\"middle\" COLSPAN=2></TD></TR>";
+ $o .= "</TABLE><input type=button CLASS=\"button\" VALUE=\"".admin_language("la_Cancel")."\" ONCLICK=\"document.location='".$CancelURL."';\">";
+ echo $o."\n";
+
+ $sql = "CREATE TABLE $table SELECT * FROM ".$objEmailQueue->SourceTable." WHERE queued=99";
+ $ado->Execute($sql);
+ //echo $sql."<br>\n";
+ for($i=0;$i<count($UserList);$i++)
+ {
+ $ToAddr = $UserList[$i];
+ //$From,$FromName,$To,$ToName,$Subject,$Text,$Html,$charset,$AttmFiles,$QueueOnly=0
+ $SendQueue->SendMail($FromAddr,$FromName,$ToAddr,"",$Subject,$Text,$Html,$charset, "",$FileName,$FileLoc,1, NULL);
+ }
+ break;
+ case "email_send_progress":
+ $sql = "SELECT * FROM $table LIMIT $start,".$MessagesPerPage;
+ // echo $sql."<br>\n";
+ $rs = $ado->Execute($sql);
+ while($rs && !$rs->EOF)
+ {
+ $data = $rs->fields;
+
+ $SendQueue->DeliverMail($data["toaddr"],$data["fromaddr"],$data["Subject"],$data["message"],$data["headers"],1);
+ $rs->MoveNext();
+ }
+ $o = "<TABLE CLASS=\"tableborder_full\" width=\"75%\">";
+ $o .= int_subsection_title_ret($PageTitle);
+ $o .="<TR border=1><TD width=\"".$pct."%\" STYLE=\"background:url('".$adminURL."/images/progress_bar_segment.gif');\">&nbsp;</TD>";
+ $comp_pct = 100-$pct;
+ $o .= "<TD bgcolor=#FFFFFF width=\"".$comp_pct."%\"></TD></TR>";
+ $o .= "</TABLE>";
+ $o .= "<input type=button VALUE=\"".admin_language("la_Cancel")."\" CLASS=\"button\" ONCLICK=\"document.location='".$CancelURL."';\">";
+
+ echo $o."\n";
+ break;
+ case "email_send_complete":
+ $sql = "DROP TABLE IF EXISTS $table";
+ $ado->Execute($sql);
+ $o = "<TABLE CLASS=\"tableborder_full\" width=\"75%\">";
+ $o .= int_subsection_title_ret($PageTitle);
+ $o .= "<TR><TD COLSPAN=2>".admin_language("la_prompt_EmailCompleteMessage")."</TD></TR>";
+ $o .= "<TD ALIGN=\"middle\" COLSPAN=2></TD></TR>";
+ $o .= "</TABLE><input type=button VALUE=\"".admin_language("la_Close")."\" CLASS=\"button\" ONCLICK=\"window.close();\">";
+ echo $o."\n";
+ break;
+ case "email_user_cancel":
+ $o = "<TABLE CLASS=\"tableborder_full\" width=\"75%\">";
+ $o .= int_subsection_title_ret($PageTitle);
+ $o .= "<TR><TD COLSPAN=2>".admin_language("la_prompt_EmailCancelMessage")."</TD></TR>";
+ $o .= "</TABLE><input type=button VALUE=\"".admin_language("la_Close")."\" CLASS=\"button\" ONCLICK=\"window.close();\">";
+ echo $o."\n";
+
+ break;
+}
+echo "</TD></TR></TABLE>";
+if(strlen($TargetURL))
+{
+?>
+<SCRIPT LANGUAGE="JavaScript">
+ document.location = '<?php echo $TargetURL; ?>';
+</SCRIPT>
+<?php
+}
+?>
+<?php int_footer(); ?>
Property changes on: branches/unlabeled/unlabeled-1.14.2/admin/email/do_send.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.14
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.14.2/core/kernel/utility/email.php
===================================================================
--- branches/unlabeled/unlabeled-1.14.2/core/kernel/utility/email.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.14.2/core/kernel/utility/email.php (revision 5434)
@@ -0,0 +1,456 @@
+<?php
+
+class kEmailMessage extends kBase {
+
+ var $Compiled;
+ var $Headers;
+ var $HeadersArray;
+ var $BodyText;
+ var $BodyHtml;
+ var $Body;
+ var $Subject;
+// var $From;
+// var $To;
+// var $ReplyTo;
+// var $CC;
+// var $BCC;
+ var $Charset;
+ var $LineFeed;
+ var $TransferEncoding;
+ var $From;
+ var $To;
+
+
+ var $IsMultipart;
+ var $Parts;
+ var $Files;
+
+
+ var $TextBoundary;
+ var $EmailBoundary;
+
+ function kEmailMessage(){
+ parent::kBase();
+ //$this->TextBoundary = uniqid(adodb_mktime());
+ $this->EmailBoundary = uniqid(adodb_mktime());
+ $this->LineFeed = "\n";
+ $this->Charset='ISO-8859-1';
+ $this->TransferEncoding='8bit';
+ $this->Body = '';
+ $this->setHeader('Subject', 'Automatically generated message');
+ $this->HeadersArray=array();
+
+ $this->setHeader('Mime-Version', '1.0');
+ }
+
+ function setHeader($header, $value){
+ $this->HeadersArray[$header] = $value;
+ $this->Compiled = false;
+ }
+
+ function fixLineBreaks($data)
+ {
+ $data = str_replace("\n\n","\r\n\r\n",$data);
+ $data = str_replace("\r\n","\n",$data);
+ $data = str_replace("\n","\r\n",$data);
+ return $data;
+ }
+
+ function setHeaders($headers){
+ $headers=$this->fixLineBreaks($headers);
+ $headers_lines = explode("\r\n", $headers);
+ foreach ($headers_lines as $line_num => $line){
+ list($header_field, $header_value) = explode(':', $line, 2);
+ $header_value = trim($header_value);
+ $this->setHeader($header_field, $header_value);
+ if ($header_field == 'Subject') $this->Subject = $header_value;
+ }
+
+ }
+
+ function appendHeader($header, $value){
+ $this->HeadersArray[$header][] = $value;
+ $this->Compiled = false;
+ }
+
+
+ function setFrom($from, $name=''){
+
+ $this->From = $from;
+
+ if ($name!=''){
+ $from = trim($name).' <'.$from.'>';
+ }
+ $this->setHeader('From', trim($from));
+ }
+
+ function setTo($to, $name=''){
+
+ $this->To = $to;
+
+ if ($name!=''){
+ $to = trim($name).' <'.$to.'>';
+ }
+
+ $this->setHeader('To', trim($to));
+ }
+
+ function setSubject($subj){
+ $this->setHeader('Subject', $subj);
+ }
+
+ function SetCC($to_cc){
+ $this->appendHeader('CC', $to_cc);
+ }
+
+ function SetBCC($to_bcc){
+ $this->appendHeader('BCC', $to_bcc);
+ }
+
+ function setReplyTo($reply_to){
+ $this->setHeader('Reply-to', $reply_to);
+ }
+
+ function Clear()
+ {
+ $this->Compiled = false;
+ $this->Body = '';
+ $this->BodyHtml = '';
+ $this->BodyText = '';
+ $this->Headers = '';
+ $this->Files = '';
+ $this->From = '';
+ $this->To = '';
+ }
+
+ function setTextBody($body_text){
+
+ $this->BodyText = $body_text;
+ $this->Compiled = false;
+ }
+
+ function setHTMLBody($body_html){
+
+ $this->BodyHtml = $body_html;
+ $this->IsMultipart = true;
+ $this->Compiled = false;
+ }
+
+
+ function convertHTMLtoPlain($text)
+ {
+ $search = Array (
+ "'(<\/td>.*)[\r\n]+(.*<td)'i",//formating text in tables
+ "'(<br[ ]?[\/]?>)|(<\/p>)|(<\/div>)|(<\/tr>)'i",
+ "'<head>(.*?)</head>'si",
+ "'<style(.*?)</style>'si",
+ "'<title>(.*?)</title>'si",
+ "'<script(.*?)</script>'si",
+// "'^[\s\n\r\t]+'", //strip all spacers & newlines in the begin of document
+// "'[\s\n\r\t]+$'", //strip all spacers & newlines in the end of document
+ "'&(quot|#34);'i",
+ "'&(amp|#38);'i",
+ "'&(lt|#60);'i",
+ "'&(gt|#62);'i",
+ "'&(nbsp|#160);'i",
+ "'&(iexcl|#161);'i",
+ "'&(cent|#162);'i",
+ "'&(pound|#163);'i",
+ "'&(copy|#169);'i",
+ "'&#(\d+);'e"
+ );
+
+ $replace = Array (
+ "\\1\t\\2",
+ "\n",
+ "",
+ "",
+ "",
+ "",
+// "",
+// "",
+ "\"",
+ "&",
+ "<",
+ ">",
+ " ",
+ chr(161),
+ chr(162),
+ chr(163),
+ chr(169),
+ "chr(\\1)"
+ );
+ return strip_tags( preg_replace ($search, $replace, $text) );
+ }
+
+ function compileBody(){
+
+ if($this->BodyHtml){
+ $not_html = $this->convertHTMLtoPlain($this->BodyHtml);
+
+// $not_html = $this->removeBlankLines($not_html);
+ // Fixing problem with add exclamation characters "!" into the body of the email.
+ $not_html = wordwrap($not_html, 72);
+ $this->BodyHtml = wordwrap($this->BodyHtml, 72);
+
+ $this->Body = '';
+ //$this->Body .= 'Content-Type: multipart/alternative;'.$this->LF()." ".'boundary="----='.$this->TextBoundary.'"'.$this->LF();
+ //$this->Body .= $this->LF();
+ $this->Body .= '------='.$this->EmailBoundary.$this->LF();
+ $this->Body .= 'Content-Type: text/plain;'." ".'charset="'.$this->Charset.'"'.$this->LF();
+ $this->Body .= $this->LF();
+ $this->Body .= $not_html.$this->LF().$this->LF();
+ $this->Body .= '------='.$this->EmailBoundary.$this->LF();
+ $this->Body .= 'Content-Type: text/html;'." ".'charset="'.$this->Charset.'"'.$this->LF();
+ $this->Body .= 'Content-Transfer-Encoding: '.$this->TransferEncoding.$this->LF();
+ $this->Body .= 'Content-Description: HTML part'.$this->LF();
+ $this->Body .= 'Content-Disposition: inline'.$this->LF();
+ $this->Body .= $this->LF();
+
+ $this->BodyHtml = str_replace("\r", "", $this->BodyHtml);
+ $this->BodyHtml = str_replace("\n", $this->LF(), $this->BodyHtml);
+
+ $this->Body .= $this->BodyHtml;
+ $this->Body .= $this->LF().$this->LF();
+
+
+ $this->IsMultipart = true;
+
+ }else{
+ $not_html = $this->convertHTMLtoPlain($this->BodyText);
+// $not_html = $this->removeBlankLines($not_html);
+ // Fixing problem with add exclamation characters "!" into the body of the email.
+ $not_html = wordwrap($not_html, 72);
+
+
+ if ($this->IsMultipart){
+ $this->Body .= '------='.$this->EmailBoundary.$this->LF();
+ $this->Body .= 'Content-Type: text/plain;'.$this->LF()." ".'charset="'.$this->Charset.'"'.$this->LF();
+ $this->Body .= 'Content-Disposition: inline'.$this->LF();
+ $this->Body .= $this->LF();
+ $this->Body .= $not_html.$this->LF().$this->LF();
+ }else{
+ //$this->BodyText = str_replace("\r", "", $this->BodyText);
+ //$this->BodyText = str_replace("\n", $this->LF(), $this->BodyText);
+ $this->Body = $not_html;
+ }
+
+ }
+
+ }
+
+ function setCharset($charset){
+ $this->Charset = $charset;
+ $this->Compiled = false;
+ }
+
+ function setLineFeed($linefeed){
+ $this->LineFeed=$linefeed;
+ }
+
+ function attachFile($filepath, $mime="application/octet-stream"){
+
+ if(is_file($filepath)){
+ $file_info = array('path'=>$filepath, 'mime'=>$mime);
+ $this->Files[] = $file_info;
+ }else{
+ die('File "'.$filepath.'" not exist...'."\n");
+ }
+
+ $this->IsMultipart = true;
+ $this->Compiled = false;
+ }
+
+ function LF($str=''){
+ $str = str_replace("\n", "", $str);
+ $str = str_replace("\r", "", $str);
+ return $str.$this->LineFeed;
+ }
+
+ function getContentType(){
+ $content_type="";
+ if ($this->IsMultipart){
+ $content_type .= $this->LF('multipart/alternative; boundary="----='.$this->EmailBoundary.'"');
+ }else{
+ $content_type .= $this->LF('text/plain;');
+ $content_type .= $this->LF(" ".'charset='.$this->Charset);
+ }
+
+ return $content_type;
+
+ }
+
+ // ========================================
+
+ function compileHeaders(){
+
+ $this->Headers="";
+
+// $this->Headers .= "From: ".$this->LF($this->From);
+ //if ($this->ReplyTo){
+// $this->Headers .= "Reply-To: ".$this->ReplyTo.$this->LF();
+ //}
+ //$this->Headers .= "To: ".$this->LF($this->To);
+ //$this->Headers .= "Subject: ".$this->LF($this->Subject);
+ /*
+ if (sizeof($this->CC)){
+ $this->Headers .= "Cc: ";
+ foreach ($this->Cc as $key => $addr){
+ $this->Headers.=$this->LF($addr.',');
+ }
+ }
+
+ if (sizeof($this->BCC)){
+ $this->Headers .= "Bcc: ";
+ foreach ($this->BCC as $key => $addr){
+ $this->Headers.=$this->LF($addr.',');
+ }
+ }
+ */
+
+ foreach ($this->HeadersArray as $key => $val){
+ if ($key=="To" || $key=="") continue; // avoid duplicate "To" field in headers
+ if (is_array($val)){
+ $val = chunk_split(implode(', ', $val),72, $this->LF().' ');
+
+
+ $this->Headers .= $key.": ".$val.$this->LF();
+ }else{
+ $this->Headers .= $key.": ".$val.$this->LF();
+ }
+
+ }
+
+ if ($this->IsMultipart) {
+ $this->Headers .= 'MIME-Version: 1.0'.$this->LF();
+ }
+ $this->Headers .= "Content-Type: ".$this->getContentType();
+
+ //$this->Headers .= "Content-Transfer-Encoding: ".$this->TransferEncoding.$this->LF();
+
+
+ }
+
+ function compileFiles(){
+ if ($this->Files){
+ foreach($this->Files as $key => $file_info)
+ {
+ $filepath = $file_info['path'];
+ $mime = $file_info['mime'];
+ $attachment_header = $this->LF('------='.$this->EmailBoundary);
+ $attachment_header .= $this->LF('Content-Type: '.$mime.'; name="'.basename($filepath).'"');
+ $attachment_header .= $this->LF('Content-Transfer-Encoding: base64');
+ $attachment_header .= $this->LF('Content-Description: '.basename($filepath));
+ $attachment_header .= $this->LF('Content-Disposition: attachment; filename="'.basename($filepath).'"');
+ $attachment_header .= $this->LF('');
+
+ $attachment_data = fread(fopen($filepath,"rb"),filesize($filepath));
+ $attachment_data = base64_encode($attachment_data);
+ $attachment_data = chunk_split($attachment_data,72);
+
+ $this->Body .= $attachment_header.$attachment_data.$this->LF('');
+ $this->IsMultipart = true;
+ }
+ }
+ }
+
+ function compile(){
+
+ if ($this->Compiled) return;
+
+ $this->compileBody();
+
+ $this->compileFiles();
+
+ $this->compileHeaders();
+
+ // Compile
+ if ($this->IsMultipart){
+ $this->Body .= '------='.$this->EmailBoundary.'--'.$this->LF();
+ }
+
+ $this->Body = $this->fixLineBreaks($this->Body);
+ $this->Headers = $this->fixLineBreaks($this->Headers);
+
+
+ $this->Compiled = true;
+ }
+
+ // ========================================
+
+ function getHeaders(){
+
+ $this->Compile();
+ return $this->Headers;
+ }
+
+ function getBody(){
+
+ $this->Compile();
+ return $this->Body;
+ }
+
+ function send(){
+
+ return mail($this->HeadersArray['To'], $this->HeadersArray['Subject'], "", $this->getHeaders().$this->LF().$this->LF().$this->getBody());
+ //return mail($this->HeadersArray['To'], $this->HeadersArray['Subject'], "", $this->getHeaders().$this->LF().$this->LF().$this->getBody(), '-f'.$this->From);
+
+ }
+
+ function sendSMTP(&$smtp_object, $smtp_host, $user, $pass, $auth_used = 0){
+
+ $params['host'] = $smtp_host; // The smtp server host/ip
+ $params['port'] = 25; // The smtp server port
+ $params['helo'] = $_SERVER['HTTP_HOST']; // What to use when sending the helo command. Typically, your domain/hostname
+ $params['auth'] = TRUE; // Whether to use basic authentication or not
+ $params['user'] = $user; // Username for authentication
+
+
+ $params['pass'] = $pass; // Password for authentication
+ $params['debug'] = 1;
+ if ($auth_used == 0){
+ $params['authmethod'] = 'NOAUTH'; // forse disabling auth
+ }
+
+
+ if (strpos($this->To, ',') !== false) {
+ $this->To = str_replace(' ', '', $this->To);
+ $send_params['recipients'] = explode(',', $this->To);
+ }
+ else {
+ $send_params['recipients'] = array($this->To); // The recipients (can be multiple)
+ }
+
+ $send_params['headers'] = explode("\r\n", $this->getHeaders());
+
+ array_unshift($send_params['headers'], 'To: '.$this->HeadersArray['To']);
+ $send_params['from'] = $this->From; // This is used as in the MAIL FROM: cmd
+ // It should end up as the Return-Path: header
+ $send_params['body']=$this->getBody();
+
+
+ if($smtp_object->connect($params) && $smtp_object->send($send_params)){
+ if ( $this->Application->isDebugMode() )
+ {
+ $this->Application->Debugger->appendHTML('<pre>'.$smtp_object->debugtext.'</pre>');
+ //define('DBG_REDIRECT', 1);
+ }
+ return true;
+ }
+ else {
+ if ( $this->Application->isDebugMode() )
+ {
+ $this->Application->Debugger->appendHTML('<pre>'.$smtp_object->debugtext.'</pre>');
+ //define('DBG_REDIRECT', 1);
+ }
+ return false;
+ }
+
+ }
+
+
+}
+
+
+
+?>
Property changes on: branches/unlabeled/unlabeled-1.14.2/core/kernel/utility/email.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.14
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.14.2/core/units/admin/admin_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.14.2/core/units/admin/admin_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.14.2/core/units/admin/admin_config.php (revision 5434)
@@ -0,0 +1,189 @@
+<?php
+
+ $config = Array(
+ 'Prefix' => 'adm',
+ 'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'AdminTagProcessor', 'file' => 'admin_tag_processor.php', 'build_event' => 'OnBuild'),
+
+
+ 'TitlePresets' => Array(
+ 'tree_root' => Array('format' => '!la_section_overview!'),
+
+ 'tree_reports' => Array('format' => '!la_section_overview!'),
+
+ 'tree_system' => Array('format' => '!la_section_overview!'),
+
+ 'tree_tools' => Array('format' => '!la_section_overview!'),
+
+ 'no_permissions' => Array('format' => '!la_title_NoPermissions!'),
+ ),
+
+ 'Sections' => Array(
+ 'in-portal:root' => Array(
+ 'parent' => null,
+ 'icon' => 'site',
+ 'label' => $this->Application->ConfigValue('Site_Name'),
+ 'url' => Array('t' => 'sections_list', 'pass' => 'm', 'pass_section' => true, 'no_amp' => 1),
+ 'permissions' => Array('advanced:admin_login', 'advanced:front_login'),
+ 'priority' => 0,
+ 'type' => stTREE,
+ ),
+
+ // "Summary & Logs" section
+ 'in-portal:reports' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'summary_logs',
+ 'label' => 'la_tab_Reports',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:log_summary' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'summary',
+ 'label' => 'la_tab_Summary',
+ 'url' => Array('index_file' => 'logs/summary.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:searchlog' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'search_log',
+ 'label' => 'la_tab_SearchLog',
+ 'url' => Array('index_file' => 'logs/searchlog.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:sessionlog' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'sessions_log',
+ 'label' => 'la_tab_SessionLog',
+ 'url' => Array('index_file' => 'logs/session_list.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:emaillog' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'email_log',
+ 'label' => 'la_tab_EmailLog',
+ 'url' => Array('index_file' => 'logs/email_log.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:visits' => Array(
+ 'parent' => 'in-portal:reports',
+ 'icon' => 'visits',
+ 'label' => 'la_tab_Visits',
+ 'url' => Array('t' => 'visits/visits_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'delete'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ // "Configuration" section
+ 'in-portal:system' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'conf',
+ 'label' => 'la_tab_Sys_Config',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:configure_general' => Array(
+ 'parent' => 'in-portal:system',
+ 'icon' => 'conf_general',
+ 'label' => 'la_tab_General',
+ 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ // "Tools" section
+ 'in-portal:tools' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'tools',
+ 'label' => 'la_tab_Tools',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:backup' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_backup',
+ 'label' => 'la_tab_Backup',
+ 'url' => Array('index_file' => 'backup/backup1.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:restore' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_restore',
+ 'label' => 'la_tab_Restore',
+ 'url' => Array('index_file' => 'backup/restore1.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:main_import' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_import',
+ 'label' => 'la_tab_ImportData',
+ 'url' => Array('index_file' => 'import/step1.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:sql_query' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'tool_import',
+ 'label' => 'la_tab_QueryDB',
+ 'url' => Array('index_file' => 'tools/sql_query.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:server_info' => Array(
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'server_info',
+ 'label' => 'la_tab_ServerInfo',
+ 'url' => Array('index_file' => 'tools/server_info.php', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ // "Help" section
+ 'in-portal:help' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'help',
+ 'label' => 'la_tab_Help',
+ 'url' => Array('index_file' => 'help/manual.pdf', 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 7,
+ 'type' => stTREE,
+ ),
+ ),
+
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.14.2/core/units/admin/admin_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.14
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline