<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — email of quotes]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=3774</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=3774&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in email of quotes.]]></description>
		<lastBuildDate>Mon, 04 Feb 2013 09:52:01 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15454#p15454</link>
			<description><![CDATA[<p>Thank Joe. HG Changeset <a href="https://frontaccounting.hg.sourceforge.net/hgweb/frontaccounting/frontaccounting/changeset/c8dc84a7d734">3178</a> did it.</p><p>Now in order to leverage it, we need new config variables or sys_prefs entries to switch between <br />the default (current for backwards compatibility) <strong>Comapny Name and Company</strong> EMail and <br />the optional <strong>User Real name and User EMail</strong><br />in determining the mail sender name and Reply-to name.<br />Sys_prefs would be preferable as they can be set on a per company basis. It should be coded to fall back to the other if one is absent.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 04 Feb 2013 09:52:01 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15454#p15454</guid>
		</item>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15449#p15449</link>
			<description><![CDATA[<p>This has been fixed and sent to HG repository.</p><p>The file /includes/current_user.inc can also be doenloaded here.</p><p>Please download and replace in /includes/current_user.inc.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Mon, 04 Feb 2013 07:50:49 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15449#p15449</guid>
		</item>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15444#p15444</link>
			<description><![CDATA[<p>@ed10: thanks for the info.</p><p>Since the users.email field is not being used anywhere in the code if acquired using get_user_by_login() (as is done here in line 81 of includes/current_user.inc), the following patch will ensure it&#039;s availability in any script that uses it:</p><div class="codebox"><pre><code>--- old/includes/current_user.inc    Thu Jan 17 19:16:02 2013
+++ new/includes/current_user.inc    Mon Feb 04 05:42:49 2013
@@ -22,6 +22,7 @@
     var $loginname;
     var $username;
     var $name;
+    var $email;
     var $company; // user&#039;s company
     var $pos;
     var $access;
@@ -120,6 +121,7 @@
                 $this-&gt;username = $this-&gt;loginname;
                 $this-&gt;prefs = new user_prefs($myrow);
                 $this-&gt;user = @$myrow[&quot;id&quot;];
+                $this-&gt;email = @$myrow[&quot;email&quot;];
                 update_user_visitdate($this-&gt;username);
                 $this-&gt;logged = true;
                 $this-&gt;last_act = time();</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 04 Feb 2013 00:23:53 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15444#p15444</guid>
		</item>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15439#p15439</link>
			<description><![CDATA[<p>In currrent_user.inc there is nothing about email so how can $_SESSION[&quot;wa_current_user&quot;]-&gt;email get populated? I have emails for all the users.&nbsp; when I print $_SESSION I get the following array with values removed:<br />&nbsp; &nbsp; [wa_current_user] =&gt; current_user Object<br />&nbsp; &nbsp; &nbsp; &nbsp; (<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [user] <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [loginname]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [username]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [name]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [company]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [pos]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [access]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [timeout]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [last_act]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [role_set] =&gt; Array<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (&nbsp; &nbsp;edited long list<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [old_db] =&gt; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [logged] =&gt; 1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [ui_mode] =&gt; 1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [prefs] =&gt; user_prefs Object<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (&nbsp; &nbsp;edited long list<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [cur_con] =&gt; 0<br />&nbsp; &nbsp; &nbsp; &nbsp; )</p><p>No email.</p><p>ed10</p>]]></description>
			<author><![CDATA[null@example.com (ed10)]]></author>
			<pubDate>Sun, 03 Feb 2013 14:24:06 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15439#p15439</guid>
		</item>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15436#p15436</link>
			<description><![CDATA[<p>Please check that the logged in user has an email entry in his record in the users table and then see if the $_SESSION[&quot;wa_current_user&quot;]-&gt;email gets populated. </p><p>Unless we try having both Reply-to in header and using the -f parameter with no error, we cannot include the code in the base repo as it has to ensure that existing installs with no postfix and just sendmail will still work.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 03 Feb 2013 14:01:40 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15436#p15436</guid>
		</item>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15434#p15434</link>
			<description><![CDATA[<p>I tried this: <br />$_SESSION[&quot;wa_current_user&quot;]-&gt;email<br />earlier and it gave me an error -- from my memory something like no $email var defined.</p><p>When I did: echo &#039;&lt;pre&gt;&#039; . print_r($_SESSION, true) . &#039;&lt;/pre&gt;&#039;;<br />it shows no email in the wa_current_user array.&nbsp; &nbsp; &nbsp; &nbsp; </p><p>I have not tried to use both methods.</p><p>I am using the latest verison of postfix for ubuntu from ubuntu repository so would be greatly surprised if my Postfix was non-compliant.</p>]]></description>
			<author><![CDATA[null@example.com (ed10)]]></author>
			<pubDate>Sun, 03 Feb 2013 00:53:17 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15434#p15434</guid>
		</item>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15432#p15432</link>
			<description><![CDATA[<p>What happens if both the <strong>headers</strong> method and the <strong>-f</strong> method are used together for <strong>Reply-to</strong> - does the mail deliver as desired? Make sure the users table has the email of the logged in user and try <strong>$_SESSION[&quot;wa_current_user&quot;]-&gt;email</strong> and see if it appears correctly.</p><br /><p>The <a href="http://www.faqs.org/rfcs/rfc2822.html">RFC2822</a>&nbsp; uses <strong>CRLF</strong> and FA&#039;s <strong>class.mail.inc</strong> uses <strong>LF</strong> only.</p><p>Article <strong>3.6.2</strong> in the <strong>RFC2822 </strong>states:<br /></p><div class="quotebox"><blockquote><p>..... an optional reply-to field MAY also be<br />&nbsp; &nbsp;included, which contains the field name &quot;Reply-To&quot; and a<br />&nbsp; &nbsp;comma-separated list of one or more addresses.</p><p>from&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&nbsp; &nbsp; &nbsp; &nbsp;&quot;From:&quot; mailbox-list CRLF</p><p>sender&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&nbsp; &nbsp; &nbsp; &nbsp;&quot;Sender:&quot; mailbox CRLF</p><p>reply-to&nbsp; &nbsp; &nbsp; &nbsp; =&nbsp; &nbsp; &nbsp; &nbsp;&quot;Reply-To:&quot; address-list CRLF</p><p>.....</p></blockquote></div><p>Maybe some non compliant versions of Postfix may need the <strong>additional parameters</strong> like <strong>-f.....</strong></p><p><strong>Caveat </strong> - in some mail systems:<br /></p><div class="quotebox"><blockquote><p>It turns out that a internet/dos style newline (\r\n) in the headers were converted to \r\r\n (ie: something mindlessly replaced all \n with \r\n without seeing if \n was already preceded by \r)</p></blockquote></div><p>_________________________<br />[size=8]Composed/Posted with <a href="http://www.shajul.net/">WYSIWYG BBCode Editor</a>[/size]</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 03 Feb 2013 00:02:38 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15432#p15432</guid>
		</item>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15431#p15431</link>
			<description><![CDATA[<p>Looking at $_SESSION[&quot;wa_current_user&quot;]&nbsp; it seems that the current user&#039;s email address is not set.&nbsp; Is that right?<br />If it isn&#039;t, I am curious why it isn&#039;t.&nbsp; If it were set then I could set the add_parm for the &#039;reply to&#039; using the email of the user who actually sends the email instead of a fixed address.&nbsp; Would be a little bit nicer. </p><p>What would really be nice would be putting all this kind of stuff into the custom report (in this case rep111 in company directory) and not the main code pages like pdf_report.inc and class.mail.inc. That would keep the custom stiff together and the main code less hacked by various FA users.&nbsp; Maybe it is not even possible, but possible or not still would be nice <img src="https://frontaccounting.com/punbb/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>ed10</p>]]></description>
			<author><![CDATA[null@example.com (ed10)]]></author>
			<pubDate>Sat, 02 Feb 2013 23:27:16 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15431#p15431</guid>
		</item>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15430#p15430</link>
			<description><![CDATA[<p>The patch didn&#039;t work here.&nbsp; When I did the patch and took the&nbsp; &#039;-f sales@mydomain.com&#039; out of var $add_params = &#039;-f sales@mydomain&#039;;&nbsp; then the returnpath went to: Return-Path: &lt;&quot;www-data@user&quot;@mydomain.com&gt;<br />so that is not right. with the -f flag in the add_parms it works.<br />I don&#039;t think you can set that Return-Path in the header, has to be separate parameter sent to postfix. </p><p>Take a look at:<br /> me at arronwoods dot com<br />1 year ago<br />I&#039;ve had all sorts of problems with scripts that don&#039;t set the &quot;-f user@example.org&quot; parameter when using mail() if postfix is the sendmail agent. ...<br />in http://php.net/manual/en/function.mail.php</p><p>ed10</p>]]></description>
			<author><![CDATA[null@example.com (ed10)]]></author>
			<pubDate>Sat, 02 Feb 2013 20:28:57 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15430#p15430</guid>
		</item>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15428#p15428</link>
			<description><![CDATA[<p><strong>Final solution</strong>:<br />1. Fix the reply to header variable as in Post 20 of this thread.<br />2. Make sure the <strong>real_name</strong> field in the users table for the logged in use is populated. <s>Otherwise take the fix from Post 25 in this thread.</s></p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 02 Feb 2013 17:34:32 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15428#p15428</guid>
		</item>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15427#p15427</link>
			<description><![CDATA[<p>Ok, got it figured out. The last test email came in just like I wanted it to (almost-the salutation is not right yet). For the user I was logged in for didn&#039;t have any entry in user table for real_name so that is why it came up blank.&nbsp; In the line:<br />$this-&gt;user = $_SESSION[&quot;wa_current_user&quot;]-&gt;name;<br />&#039;name&#039; is taken from the &#039;real_name&#039; field in the user table. (I thought it was the user_id)</p><p>At least that is what it looks like right now.&nbsp; Time to take a break and look at it all again tomorrow to see if I have it all the way I want it.</p><p>Tomorrow is work on Mercurial day also, can&#039;t seem to get it to work right for me.</p>]]></description>
			<author><![CDATA[null@example.com (ed10)]]></author>
			<pubDate>Sat, 02 Feb 2013 17:31:02 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15427#p15427</guid>
		</item>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15426#p15426</link>
			<description><![CDATA[<p>Only 2 files use the&nbsp; <strong>$_SESSION[&quot;wa_current_user&quot;]-&gt;loginname</strong> variable:</p><p>Line 82 in <strong>includes/errors.inc</strong>:<br /></p><div class="codebox"><pre><code>        $user = @$_SESSION[&quot;wa_current_user&quot;]-&gt;loginname;</code></pre></div><p>and Line 55 in <strong>reporting/includes/printer_class.inc</strong>:<br /></p><div class="codebox"><pre><code>        $ctrl = &quot;H&quot;.$server.&quot;\nP&quot;. substr($_SESSION[&quot;wa_current_user&quot;]-&gt;loginname,0,31) </code></pre></div><p>It is always the same as <strong>$_SESSION[&quot;wa_current_user&quot;]-&gt;username</strong> - would the devs want to standardize?.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 02 Feb 2013 17:29:53 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15426#p15426</guid>
		</item>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15425#p15425</link>
			<description><![CDATA[<p><strong>@ed10</strong>: While I was documenting the code trace back to where the variables were set, you beat me to it!</p><p>You can actually dump the specific session variable:<br /></p><div class="codebox"><pre><code>echo print_r($_SESSION[&quot;wa_current_user&quot;], true);</code></pre></div><p>at the location of the <strong>send()</strong> and see what is the output!</p><p>Line 95 in <strong>admin/db/users_db.inc</strong> in <strong>function get_users_by_login()</strong>:<br /></p><div class="codebox"><pre><code>$sql = &quot;SELECT * FROM &quot;.TB_PREF.&quot;users WHERE user_id=&quot;.db_escape($user_id);</code></pre></div><p>Hence all fields must be available and in your instance, the <strong>real_name</strong> field may not have been set, though in the email instance, the <strong>username</strong> may be okay.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 02 Feb 2013 17:10:12 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15425#p15425</guid>
		</item>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15424#p15424</link>
			<description><![CDATA[<p>In <strong>includes/session.inc</strong>, <em><strong>outside </strong></em>of the class definition, in the <strong>function login_timeout()</strong> line 402 is:<br /></p><div class="codebox"><pre><code>$_SESSION[&quot;wa_current_user&quot;] = new current_user();</code></pre></div><p>Class <strong>current_user</strong> is defined in <strong>includes/current_user.inc</strong>, having class variables <strong>$loginname</strong>, <strong>$name</strong> and <strong>$username</strong> all set to <strong>empty strings</strong> in the constructor at line 42.</p><p><strong>current_user::login()</strong> method on successful authorisation at line 81:<br /></p><div class="codebox"><pre><code>$myrow = get_user_by_login($loginname);</code></pre></div><p>and sets the <strong>current_user class variables</strong><br /></p><div class="codebox"><pre><code>                $this-&gt;name = $myrow[&quot;real_name&quot;];
                $this-&gt;pos = $myrow[&quot;pos&quot;];
                $this-&gt;loginname = $loginname;
                $this-&gt;username = $this-&gt;loginname;
                $this-&gt;prefs = new user_prefs($myrow);
                $this-&gt;user = @$myrow[&quot;id&quot;];</code></pre></div><p>If the session variable <strong>user</strong> is available, ordinarily from the above code, the session variable <strong>name</strong> should also be available.</p><p>When a <strong>login timeout</strong> occurs, this may not get executed fully and some session variables may get <strong>unset</strong> (needs to be checked).</p><p><s>Somewhere the session variable<strong>name</strong>is getting set to an empty string after having been logged in, if it is empty.</s></p><p>Hence check by replacing the line 269 in <strong>reporting/includes/pdf_report.inc</strong> with any of the following:</p><div class="codebox"><pre><code>$this-&gt;user = $_SESSION[&quot;wa_current_user&quot;]-&gt;loginname;

// or

$this-&gt;user = $_SESSION[&quot;wa_current_user&quot;]-&gt;username;</code></pre></div><p>and see what happens!</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 02 Feb 2013 17:06:45 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15424#p15424</guid>
		</item>
		<item>
			<title><![CDATA[Re: email of quotes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15423#p15423</link>
			<description><![CDATA[<p>i got the user name by changing:<br />$this-&gt;user = $_SESSION[&quot;wa_current_user&quot;]-&gt;user;<br />to<br />$this-&gt;user = $_SESSION[&quot;wa_current_user&quot;]-&gt;username;</p><p>Isn&#039;t it used when you show the users who are logged in at the bottom of the pages?</p>]]></description>
			<author><![CDATA[null@example.com (ed10)]]></author>
			<pubDate>Sat, 02 Feb 2013 16:54:14 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15423#p15423</guid>
		</item>
	</channel>
</rss>
