11-27-2012, 11:35 AM
Here is my solution for public access:
- Premise: Only admins can upload files
- Create a Public Department and a Public User for that Department
- Make a copy of index.php and name it index-r.php
- Edit the index-r.php to autologin the public user. ( Reference Post:http://www.opendocman.com/forum/viewtopic.php?f=4&t=714&p=1906&hilit=index+r.php#p1906 )
Remark out line 63: if(isset($_Post['login']))
Remark out the { on line 64 using //
Change line 71 to hard code an ID: $frmuser = "username";
Change line 72 to hard code a Password: $frmpass= "password";
Remark out lines 119-130, start with /* and end with */
- Now edit the template header file (header.tpl) in the folder of the template you are using (mine was tweeter)
Add {if $isadmin eq 'yes'} in front of the buttons you want to turn off, (ie upload, logout, checkin) and {/if} after
Example:
<ul class="nav">
<li class="active"><a href="{$g_base_url}/out.php">Home</a></li>
{if $isadmin eq 'yes'}
<li><a href="{$g_base_url}/in.php">{$g_lang_button_check_in}</a></li>
{/if}
<li><a href="{$g_base_url}/search.php">{$g_lang_search}</a></li>
{if $isadmin eq 'yes'}
<li><a href="{$g_base_url}/add.php">{$g_lang_button_add_document}</a>
</li>
{/if}
{if $isadmin eq 'yes'}
<li>
<a href="{$g_base_url}/admin.php">{$g_lang_label_admin}</a>
</li>
{/if}
{if $isadmin eq 'yes'}
<li><a href="{$g_base_url}/logout.php">{$g_lang_logout}</a></li>
{/if}
</ul>
<p class="navbar-text pull-right">
{if $isadmin eq 'yes'}
Logged in as
<a href="{$base_url}/profile.php">{$userName}</a>
</p>
{/if}
- Edit the english.php page located here: includes>language and add a link to your public page
edit these to say:
$lang['welcome'] = 'Document Management System';
$lang['welcome2'] = "<a href='./index-r.php'>Click Here for Public Documents</a>";
- Finally just mark you documents with user public as view only.[/list:u]
References that got me started:- Bottom of this post got me started - <!-- l --><a class="postlink-local" href="http://www.opendocman.com/forum/viewtopic.php?f=4&t=81">viewtopic.php?f=4&t=81</a><!-- l -->
- Index page mods: <!-- l --><a class="postlink-local" href="http://www.opendocman.com/forum/viewtopic.php?f=4&t=714&p=1906&hilit=index+r.php#p1906">viewtopic.php?f=4&t=714&p=1906&hilit=index+r.php#p1906</a><!-- l -->[/list:u]
- Bottom of this post got me started - <!-- l --><a class="postlink-local" href="http://www.opendocman.com/forum/viewtopic.php?f=4&t=81">viewtopic.php?f=4&t=81</a><!-- l -->