<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Security Role Clone / Addition errors on edit / save]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=5660</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5660&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Security Role Clone / Addition errors on edit / save.]]></description>
		<lastBuildDate>Sun, 05 Apr 2015 15:35:13 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Security Role Clone / Addition errors on edit / save]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23108#p23108</link>
			<description><![CDATA[<p>The <strong>ui_input.inc</strong> fix was <a href="https://github.com/FrontAccountingERP/FA/commit/4507cd0059703d39f3e31230c9abe7494334ef4f">committed</a> after the release of <a href="https://github.com/FrontAccountingERP/FA/commit/1f3dea6295d48fe11577daf8a9fce40a70b23c55">FA v2.3.24</a>.</p><p>Thanks for your diligence in ferreting out this bug and testing it through to it&#039;s logical end!</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 05 Apr 2015 15:35:13 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23108#p23108</guid>
		</item>
		<item>
			<title><![CDATA[Re: Security Role Clone / Addition errors on edit / save]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23106#p23106</link>
			<description><![CDATA[<p>Thanks for the help and tips, now it seems to work as expected!<br />I have updated to version 2.3.24 by downloading the archive file from sourceforge.net, and followed the instructions in your Update Guide.<br />Please note that the updated file &quot;ui_controls.inc&quot; is currently not included in the archive file available on sourceforge.net. Refer to the topic &quot;Report Bugs here » Problems with editing customer contacts&quot;.</p><p>Best regards</p>]]></description>
			<author><![CDATA[null@example.com (pilotspelman)]]></author>
			<pubDate>Sun, 05 Apr 2015 12:18:31 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23106#p23106</guid>
		</item>
		<item>
			<title><![CDATA[Re: Security Role Clone / Addition errors on edit / save]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23096#p23096</link>
			<description><![CDATA[<p>The problem you are getting is because all areas have been stored in the security_roles tables for all roles that got edited with the erroneous file. Start afresh for the security_roles table and see how it goes.</p><p>Check out the latest FA v2.3.24 and see if that solves your problems.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 04 Apr 2015 20:25:06 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23096#p23096</guid>
		</item>
		<item>
			<title><![CDATA[Re: Security Role Clone / Addition errors on edit / save]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23088#p23088</link>
			<description><![CDATA[<p>Thanks for your efforts!</p><p>I may have misunderstood how your patch (fix) should be implemented, but I downloaded the attachment in the last replay. From the attachment, I extracted the new/updated file &quot;security_roles.php&quot;, and replaced the previous file on the server (in the directory &quot;admin&quot;) with this updated file.</p><p>However, after this procedure the problem now seems to be reversed. I.e. all the elements in each group will become unselected instead of the previous problem with all elements being selected.</p><p>Here is a link to screenshots that illustrate the new problem: http://shares.jansson-fam.se/s#27218b90-96ce-4e18-91b5-2a8547eea422/bo.clouddrive.jansson-fam.se/FA_Errors/</p><p>In addition, I have discovered another problem compared with the previous version (FA 2.3.22) regarding editing of customers, but I will describe this in a new post (new topic).</p>]]></description>
			<author><![CDATA[null@example.com (pilotspelman)]]></author>
			<pubDate>Sat, 04 Apr 2015 05:03:57 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23088#p23088</guid>
		</item>
		<item>
			<title><![CDATA[Re: Security Role Clone / Addition errors on edit / save]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23066#p23066</link>
			<description><![CDATA[<p>Finally fixed it - it was failing since the value of the checked element was not being tested:</p><div class="codebox"><pre><code>--- admin/security_roles.php    Sat Mar 14 20:35:36 2015
+++ admin/security_roles.php    Thu Apr 02 11:09:29 2015
@@ -85,8 +85,8 @@
         $sections = array();
         $areas = array();
         foreach($_POST as $p =&gt;$val) {
-            if (substr($p,0,4) == &#039;Area&#039;) {
-                $a = substr($p, 4);
+            if (substr($p,0,4) == &#039;Area&#039; &amp;&amp; $val == 1) {
+                $a = (int)substr($p, 4);
                 if (($a&amp;~0xffff) &amp;&amp; (($a&amp;0xff00)&lt;(99&lt;&lt;8))) {
                     $sections[] = $a&amp;~0xff;    // add extended section for plugins
                 }</code></pre></div><p>The devs can now port it to FA 2.4 as well using the same patch file.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Thu, 02 Apr 2015 05:46:52 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23066#p23066</guid>
		</item>
		<item>
			<title><![CDATA[Re: Security Role Clone / Addition errors on edit / save]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23064#p23064</link>
			<description><![CDATA[<p>The fix needs to be corrected since the database storage symptoms are still there although the GUI shows it correctly:</p><p>Salesman Role:<br /></p><div class="codebox"><pre><code>sections: 768;3072;5632;8192;15872
areas: 773;774;3073;3075;3081;5633;8194;15873</code></pre></div><p>Cloning Salesman as SalesWoman and adding in 2 areas to existing section and 1 area to new section results in:<br /></p><div class="codebox"><pre><code>sections: 768;3072;5632;5888;8192;15872
areas: 773;774;3073;3075;3081;5633;5889;8194;15873;15874;15875;513;514;515;516;517;518;519;520;521;522;523;524;525;526;2817;2818;2819;2820;2821;2822;2823;3329;3330;3331;3332;3333;3334;3335;5377;7937;7938;7939;7940;8449;8450;8451;10497;10753;10754;10755;10756;10757;11009;11010;11011;11012;13057;13313;13314;13315;15617;15618;15619;15620;15621;15622;15623;15624;15628;15625;15626;15627;15629;16129;16130;16131;16132</code></pre></div><p>but it should be:</p><div class="codebox"><pre><code>sections: 768;3072;5632;5888;8192;15872
areas: 773;774;3073;3075;3081;5633;5889;8194;15873;15874;15875</code></pre></div><p>Eliminating all blank areas is better than choosing all selected areas if a mere presence is checked instead of the value!</p><p>This persists even in FA 2,4 where an extra permission 775 (Edit other users transactions) is given to Salesman role - is this intended? If so, would it not be better to keep the 775 along with 773 and 774 instead of at the end in the insert statement statements in the CoAs? This (775) seems to be so for practically every role!</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Thu, 02 Apr 2015 04:43:00 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23064#p23064</guid>
		</item>
		<item>
			<title><![CDATA[Re: Security Role Clone / Addition errors on edit / save]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23056#p23056</link>
			<description><![CDATA[<p>What a nice way to Ajax the whole page temporarily! Thanks for the <a href="https://github.com/FrontAccountingERP/FA/commit/4052beb0e908e206956eee5b479de283173d1801">real fix</a> - that was fast - will test and revert.</p><p>When you release the FA v2.3.24, please make the now unused field <strong>0_sys_types.type_no = 1</strong> for all records in both CoAs in the insert statements.</p><p>Also &quot;<a href="https://github.com/apmuthu/frontaccounting/commit/0e62977d5ae6589f151ceb701206c1d93d992b59">stay in old page when customer is updated fix</a>&quot; can also be committed.</p><p>To prevent uneditable item descriptions in &quot;purchasing&quot; files from being unnecessarily being updated with same content (and mangling special characters), <a href="https://github.com/apmuthu/frontaccounting/commit/1cb957b000b452a4f0e005c465eb49a561e6dd52#diff-b63b393d8647b5200ab6816d9d1f2af4">my commits to the files</a>:<br /> FAMods/purchasing/includes/po_class.inc <br /> FAMods/purchasing/includes/ui/po_ui.inc <br /> FAMods/purchasing/po_entry_items.php <br />may be taken into the new release as well.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 01 Apr 2015 19:28:48 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23056#p23056</guid>
		</item>
		<item>
			<title><![CDATA[Re: Security Role Clone / Addition errors on edit / save]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23054#p23054</link>
			<description><![CDATA[<p>Yes, indeed, the problem exists. The regression was introduced with latest fixes before 2.3.23 release. I have just pushed fix to the problem into stable branch. The most easy fix for the issue is changing lines 47-49 to:<br /></p><div class="codebox"><pre><code>if (list_updated(&#039;role&#039;)) {
    $Ajax-&gt;activate(&#039;_page_body&#039;);
}</code></pre></div><p>Until&nbsp; that changing security roles setup should be avoided. We plan to make&nbsp; bugfix FA release fixing the problem in next hours. </p><p>Janusz</p>]]></description>
			<author><![CDATA[null@example.com (itronics)]]></author>
			<pubDate>Wed, 01 Apr 2015 17:26:57 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23054#p23054</guid>
		</item>
		<item>
			<title><![CDATA[Re: Security Role Clone / Addition errors on edit / save]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23053#p23053</link>
			<description><![CDATA[<p>Further analysis on attempting to clone the simplest role: Salesman<br /></p><div class="codebox"><pre><code>sections: 768;3072;5632;8192;15872
areas: 773;774;3073;3075;3081;5633;8194;15873</code></pre></div><p>into a new role SalesWoman with extra permissions:<br /></p><div class="codebox"><pre><code>section: Inventory analytics    
area: Reorder levels

section: Banking &amp; GL transactions
area: GL postings view     
area: Exchange rate table changes</code></pre></div><p>should have resulted in:</p><div class="codebox"><pre><code>sections: 768;3072;5632;8192;8448;15872
areas: 773;774;3073;3075;3081;5633;8194;8449;15873;15874;15875</code></pre></div><p>but in actuality resulted in the same section field but with extra areas as in:</p><div class="codebox"><pre><code>sections: 768;3072;5632;8192;8448;15872
areas: 773;774;3073;3075;3081;5633;8194;8449;15873;15874;15875;513;514;515;516;517;518;519;520;521;522;523;524;525;526;2817;2818;2819;2820;2821;2822;2823;3329;3330;3331;3332;3333;3334;3335;5377;5889;5890;5891;7937;7938;7939;7940;8450;8451;10497;10753;10754;10755;10756;10757;11009;11010;11011;11012;13057;13313;13314;13315;15617;15618;15619;15620;15621;15622;15623;15624;15628;15625;15626;15627;15629;16129;16130;16131;16132</code></pre></div><p>It is clear that the routine parsing the <strong>areas</strong> is wrong as it takes all areas for the given <strong>sections</strong> instead of the chosen ones alone, appending the rest to the proper ones.</p><p>This may be alleviated if the next <strong>area</strong> to be inserted is greater than those already in the <strong>area list</strong>.</p><p>As usual, functions are interspersed with sequential code in <strong>admin/security_roles.php</strong> where all this presumably occurs or triggers.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 01 Apr 2015 14:49:52 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23053#p23053</guid>
		</item>
		<item>
			<title><![CDATA[Security Role Clone / Addition errors on edit / save]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23051#p23051</link>
			<description><![CDATA[<p>Moved discussion from <a href="https://frontaccounting.com/punbb/viewtopic.php?pid=23037#p23037">@pilotspelman</a>&#039;s post here as it is a different topic.</p><p>Verified that this error exists:<br />Clone a Role, change the role name and description, make role changes and insert as new role.</p><p>The role is inserted - but - Elements not selected in existing selected groups will remain unselected as it should be. If any new Access group was chosen, then all elements in them will get selected even if some of them were not chosen which is wrong.</p><p>Now if the newly created role is chosen and edited, then any group with any elements currently selected or remained selected, will get all elements of those groups selected even if they were unselected when saved which is certainly wrong.</p><p>Attached are the screenshots.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 01 Apr 2015 14:06:09 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23051#p23051</guid>
		</item>
	</channel>
</rss>
