<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Add_access_extensions() Function Call]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6133&amp;type=atom" />
	<updated>2020-08-17T06:53:08Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=6133</id>
		<entry>
			<title type="html"><![CDATA[Re: Add_access_extensions() Function Call]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=38054#p38054" />
			<content type="html"><![CDATA[<p>Another way to overcome this,</p><p>use the activate_extension function in module</p><div class="codebox"><pre><code>function activate_extension($company, $check_only = true)
    {
        global $path_to_root, $db_connections;

        $file = $path_to_root . &#039;/includes/session.inc&#039;;
        if (file_exists($file)) {
            $mstring = &#039;add_access_extensions();&#039;;
            // Open the file to get existing content
            $current = file_get_contents($file);
            if (strpos($current, $mstring) === false) {
                $current .= $mstring . &quot;\n&quot;;
                // Write the contents back to the file
                file_put_contents($file, $current);
            }
        }
        
        $updates = array(&#039;update.sql&#039; =&gt; array(&#039;pos&#039;));
        return $this-&gt;update_databases($company, $updates, $check_only);
    }</code></pre></div>]]></content>
			<author>
				<name><![CDATA[anoopmb]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18207</uri>
			</author>
			<updated>2020-08-17T06:53:08Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=38054#p38054</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Add_access_extensions() Function Call]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25204#p25204" />
			<content type="html"><![CDATA[<p>I think set_ext_domain() is for separating .po files for each extension isn&#039;t it?<br />I think we need to call the add_access_extension() function in session.inc, or we should call it in each module, or we should manually add $security_areas item for the new extension in includes/access_level.inc. CMIIW.</p>]]></content>
			<author>
				<name><![CDATA[bogeyman2007]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20681</uri>
			</author>
			<updated>2016-02-16T05:05:18Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25204#p25204</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Add_access_extensions() Function Call]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25191#p25191" />
			<content type="html"><![CDATA[<p>There are many places where the session.inc file is included but the add_access_extension() is not called.</p><p>Please use the &quot;set_ext_domain()&quot; function - see some extensions for examples like <a href="https://github.com/apmuthu/frontaccounting/blob/master/extensions/Extensions/asset_register/reporting/rep_assets_list.php#L26">this</a>. Even the logout.php file does not call the add_access_extension() function.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-02-14T18:26:16Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25191#p25191</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Add_access_extensions() Function Call]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25189#p25189" />
			<content type="html"><![CDATA[<p>Hi,</p><p>Is there any possibility to move the function call add_access_extensions() from index.php into the last line of includes/session.inc? Because I found a problem when I develop an extension that create an additional tab.</p><p>That new tab is appear when I click the other tab. So I&#039;m on the URL like following:<br />index.php?application=stock<br />Because the add_access_extension is called in index.php</p><p>But when I click one menu, which point to the URL like following.<br />inventory/transfers.php?NewTransfer=1<br />My new tab is disappear and there is an error message saying undefined index SA_blablabla.<br />I found that was because the add_access_extension is not called in that page.</p><p>So I think we should move the add_access_extensions() function call to the includes/session.inc file which is called in every page. It could be a bug or me that was wrong, so I need the opinion from you guys about this.</p>]]></content>
			<author>
				<name><![CDATA[bogeyman2007]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20681</uri>
			</author>
			<updated>2016-02-14T07:44:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25189#p25189</id>
		</entry>
</feed>
