<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://atk-framework.com/index.php?action=history&amp;feed=atom&amp;title=Bypass_Login_and_Set_Guest_Privileges</id>
	<title>Bypass Login and Set Guest Privileges - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://atk-framework.com/index.php?action=history&amp;feed=atom&amp;title=Bypass_Login_and_Set_Guest_Privileges"/>
	<link rel="alternate" type="text/html" href="https://atk-framework.com/index.php?title=Bypass_Login_and_Set_Guest_Privileges&amp;action=history"/>
	<updated>2026-09-20T19:44:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://atk-framework.com/index.php?title=Bypass_Login_and_Set_Guest_Privileges&amp;diff=7321&amp;oldid=prev</id>
		<title>bahtiar: New page: {{howto|Advanced|Marlon Bilog &lt;marlbil at gmail dot com&gt; &lt;br&gt;&lt;br&gt;This will enable your ATK site to bypass the login page auto-logged-in as a guest user.  Also, possibly allow guest use...</title>
		<link rel="alternate" type="text/html" href="https://atk-framework.com/index.php?title=Bypass_Login_and_Set_Guest_Privileges&amp;diff=7321&amp;oldid=prev"/>
		<updated>2008-02-06T11:35:55Z</updated>

		<summary type="html">&lt;p&gt;New page: {{howto|Advanced|&lt;a href=&quot;/index.php?title=Marlon_Bilog&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Marlon Bilog (page does not exist)&quot;&gt;Marlon Bilog&lt;/a&gt; &amp;lt;marlbil at gmail dot com&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;This will enable your ATK site to bypass the login page auto-logged-in as a guest user.  Also, possibly allow guest use...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{howto|Advanced|[[Marlon Bilog]] &amp;lt;marlbil at gmail dot com&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;This will enable your ATK site to bypass the login page auto-logged-in as a guest user.  Also, possibly allow guest users to view (readonly) some nodes or register a new user account to the system or to make other transactions in your site (example: feedbacks, testimonials).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Warning: This How-To has been reported to have problems with the recent version of ATK and is currently being updated.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
1. &amp;#039;&amp;#039;&amp;#039;Create a profile&amp;#039;&amp;#039;&amp;#039; (I used - &amp;#039;&amp;#039;&amp;quot;Guest Profile&amp;quot;&amp;#039;&amp;#039;) for your guests. For a start, I have enabled only the &amp;quot;admin&amp;quot; access rights to the nodes I want guest users to see. And to enable user registration and other guest actions, I enabled the &amp;quot;add&amp;quot; access to my user node (or on a separate user registration node/table) and other actions on nodes that you may want guests to have access to.&lt;br /&gt;
&lt;br /&gt;
2. &amp;#039;&amp;#039;&amp;#039;Add a user&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;quot;Guest Account&amp;quot;&amp;#039;&amp;#039;) account with no username and password to your user table. This will be the initial account of anyone who visits your site and has not logged-in yet.&lt;br /&gt;
&lt;br /&gt;
3. &amp;#039;&amp;#039;&amp;#039;Assign&amp;#039;&amp;#039;&amp;#039; the &amp;#039;&amp;#039;&amp;quot;Guest Profile&amp;quot;&amp;#039;&amp;#039; to the &amp;#039;&amp;#039;&amp;quot;Guest Account&amp;quot;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
4. &amp;#039;&amp;#039;&amp;#039;Edit ./config.inc.php&amp;#039;&amp;#039;&amp;#039; to allow multiple authentications including &amp;quot;none&amp;quot;. Here, I used the &amp;quot;none&amp;quot; authentication for guest users and &amp;quot;db&amp;quot; for registered users. Also, uncomment the $config_authorization, and set it the same as your second authentication type. This prevents ATK from loading &amp;quot;auth_none, db&amp;quot; (as in my $config_authentication) which results in a fatal error because atk does not handle yet multiple authorizations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
   $config_authentication = &amp;quot;none, db&amp;quot;;&lt;br /&gt;
   $config_authorization = &amp;quot;db&amp;quot;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. &amp;#039;&amp;#039;&amp;#039;Edit ./atk/security/class.auth_none.inc&amp;#039;&amp;#039;&amp;#039; to disable logging-in of unknown accounts. Here, we only allow guests to login if there was no username entered when attempting to login.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  function validateUser($user, $passwd)&lt;br /&gt;
  {&lt;br /&gt;
    if ($user == &amp;quot;&amp;quot;)&lt;br /&gt;
      return AUTH_SUCCESS;&lt;br /&gt;
    else&lt;br /&gt;
      return AUTH_MISMATCH;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. &amp;#039;&amp;#039;&amp;#039;Edit line 43-56 of ./top.php&amp;#039;&amp;#039;&amp;#039; to change &amp;#039;&amp;#039;&amp;quot;Logged in as: &amp;lt;username&amp;gt; Logout&amp;quot;&amp;#039;&amp;#039; to &amp;#039;&amp;#039;&amp;quot;Members: Login&amp;quot;&amp;#039;&amp;#039; on the initial site visit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  //Backwards compatible $content, that is what will render when the box.tpl is used instead of a top.tpl&lt;br /&gt;
  $loggedin = ($g_user[&amp;quot;name&amp;quot;]==&amp;quot;&amp;quot;)? text(&amp;quot;members&amp;quot;).&amp;quot;:&amp;quot; : text(&amp;quot;logged_in_as&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;atk&amp;quot;).&amp;quot;: &amp;amp;lsaquo;b&amp;amp;rsaquo;&amp;quot;.$g_user[&amp;quot;name&amp;quot;].&amp;quot;&amp;amp;lsaquo;/b&amp;amp;rsaquo;&amp;quot;;&lt;br /&gt;
  $content = &amp;#039;&amp;amp;lsaquo;br/&amp;amp;rsaquo;&amp;#039;.$loggedin.&amp;#039; &amp;amp;nbsp; &amp;lt;a href=&amp;quot;app.php?atklogout=1&amp;quot; target=&amp;quot;_top&amp;quot;&amp;gt;&amp;#039;.(($g_user[&amp;quot;name&amp;quot;]==&amp;quot;&amp;quot;)? ucfirst(atktext(&amp;quot;login&amp;quot;)) : ucfirst(atktext(&amp;quot;logout&amp;quot;))).&amp;#039;&amp;lt;/a&amp;gt;&amp;amp;nbsp;&amp;amp;lsaquo;br/&amp;amp;rsaquo;&amp;amp;lsaquo;br/&amp;amp;rsaquo;&amp;#039;;&lt;br /&gt;
  $top = $ui-&amp;gt;renderBox(array(&amp;quot;content&amp;quot;=&amp;gt; $content,&lt;br /&gt;
                 &amp;quot;logintext&amp;quot; =&amp;gt; ($g_user[&amp;quot;name&amp;quot;]==&amp;quot;&amp;quot;)? atktext(&amp;quot;members&amp;quot;) : atktext(&amp;quot;logged_in_as&amp;quot;),&lt;br /&gt;
                              &amp;quot;logouttext&amp;quot; =&amp;gt; ($g_user[&amp;quot;name&amp;quot;]==&amp;quot;&amp;quot;)? ucfirst(atktext(&amp;quot;login&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;atk&amp;quot;)) : ucfirst(atktext(&amp;quot;logout&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;atk&amp;quot;)),&lt;br /&gt;
                              &amp;quot;logoutlink&amp;quot; =&amp;gt; &amp;quot;index.php?atklogout=1&amp;quot;,&lt;br /&gt;
                              &amp;quot;logouttarget&amp;quot;=&amp;gt;&amp;quot;_top&amp;quot;,&lt;br /&gt;
                              &amp;quot;centerpiece&amp;quot;=&amp;gt;&amp;quot;&amp;quot;,&lt;br /&gt;
                              &amp;quot;searchpiece&amp;quot;=&amp;gt;&amp;quot;&amp;quot;,&lt;br /&gt;
                              &amp;quot;title&amp;quot; =&amp;gt; atktext(&amp;quot;app_title&amp;quot;),&lt;br /&gt;
                              &amp;quot;user&amp;quot;   =&amp;gt; $g_user[&amp;quot;name&amp;quot;]),&lt;br /&gt;
                              &amp;quot;top&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... and for those using the dropdown menu (ATK 5.7 - Nightly):&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Edit line 63 of ./atk/menu/class.atkdropdownmenu.inc&amp;#039;&amp;#039;&amp;#039; to point the logout link to ./index.php and render the logout link correctly.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
        global $g_user; // added&lt;br /&gt;
        $menu.=&amp;quot;    &amp;amp;lsaquo;li&amp;amp;rsaquo;&amp;lt;a href=&amp;#039;index.php?atklogout=1&amp;#039;&amp;gt;&amp;quot;.(($g_user[&amp;quot;name&amp;quot;]==&amp;quot;&amp;quot;)? (atktext(&amp;quot;members&amp;quot;).&amp;quot;: &amp;quot;.atktext(&amp;quot;login&amp;quot;)) : (atktext(&amp;#039;logout&amp;#039;).&amp;quot; &amp;quot;.$g_user[&amp;quot;name&amp;quot;])).&amp;quot;&amp;lt;/a&amp;gt;&amp;amp;lsaquo;/li&amp;amp;rsaquo;\n&amp;quot;; // edited&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. &amp;#039;&amp;#039;&amp;#039;Add&amp;#039;&amp;#039;&amp;#039; to your language file the &amp;#039;&amp;#039;&amp;#039;translation&amp;#039;&amp;#039;&amp;#039; for &amp;#039;&amp;#039;&amp;quot;members&amp;quot;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;quot;members&amp;quot; =&amp;gt; &amp;quot;Members&amp;quot;,&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>bahtiar</name></author>
	</entry>
</feed>