<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[iRedMail — trackLastLogin.sh doesn't update all fields with mysql]]></title>
	<link rel="self" href="http://www.iredmail.org/forum/feed-atom-topic522.xml" />
	<updated>2010-01-02T10:20:46Z</updated>
	<generator>PunBB</generator>
	<id>http://www.iredmail.org/forum/topic522-tracklastloginsh-doesnt-update-all-fields-with-mysql.html</id>
		<entry>
			<title type="html"><![CDATA[trackLastLogin.sh doesn't update all fields with mysql]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post2204.html#p2204" />
			<content type="html"><![CDATA[<p>the provided script here <a href="http://iredmail.googlecode.com/hg/extra/trackLastLogin.sh">http://iredmail.googlecode.com/hg/extra … stLogin.sh</a> has a problem with mysql. the fields `lastlogindate`and `lastloginipv4` are not set due to the &quot;&quot; around the two functions in the update statement.&nbsp; </p><p>the following should be changed</p><p><strong>old</strong><br /></p><div class="codebox"><pre><code>#if [ X&quot;${USER}&quot; != X&quot;dump-capability&quot; ]; then 
#   mysql -u${MYSQL_USER} -p${PASSWD} ${VMAIL_DB_NAME} &gt;/dev/null 2&gt;&amp;1 &lt;&lt;EOF 
#       UPDATE mailbox SET \ 
#       lastloginipv4=&quot;INET_ATON(&#039;$IP&#039;)&quot;, \ 
#       lastlogindate=&quot;NOW()&quot;, \ 
#       lastloginprotocol=&quot;${1}&quot; \ 
#       WHERE username=&#039;$USER&#039;; 
#EOF 
#fi</code></pre></div><p><strong>new</strong><br /></p><div class="codebox"><pre><code>#if [ X&quot;${USER}&quot; != X&quot;dump-capability&quot; ]; then 
#   mysql -u${MYSQL_USER} -p${PASSWD} ${VMAIL_DB_NAME} &gt;/dev/null 2&gt;&amp;1 &lt;&lt;EOF 
#       UPDATE mailbox SET \ 
#       lastloginipv4=INET_ATON(&#039;$IP&#039;), \ 
#       lastlogindate=NOW(), \ 
#       lastloginprotocol=&quot;${1}&quot; \ 
#       WHERE username=&#039;$USER&#039;; 
#EOF 
#fi</code></pre></div><p>now the both fields are updated right, else they are not updated at all only `lastloginprotocol`is updated else</p>]]></content>
			<author>
				<name><![CDATA[BigMichi1]]></name>
				<uri>http://www.iredmail.org/forum/user295.html</uri>
			</author>
			<updated>2010-01-02T10:20:46Z</updated>
			<id>http://www.iredmail.org/forum/post2204.html#p2204</id>
		</entry>
</feed>
