Hi everyone,
I tried to alter the code so I can display a custom message for anonymous user with disabled upload turn on, by basically saying something like "You need to register to able to upload" by altering the upload_form.html with codes like these:
<TMPL_UNLESS premium>
<div style="font-size: 13px;">To start upload. You must be a registered user. Please <a href="mysite.com/?op=registration">register on the site.</a></div>
</TMPL_UNLESS>
I also try
<TMPL_IF anon>
<div style="font-size: 13px;">To start upload. You must be a registered user. Please <a href="mysite.com/?op=registration">register on the site.</a></div>
</TMPL_IF>
and
<TMPL_IF anonymous>
<div style="font-size: 13px;">To start upload. You must be a registered user. Please <a href="mysite.com/?op=registration">register on the site.</a></div>
</TMPL_IF>
None of these appear to be working. Does anyone have a working solution for this? If you have, any help would be greatly appreciated. Thank you.
XFileSharing Pro - How to display a message for anonymous with upload disabled?
Like in XFS 1.8? I've found in 2.0 if anonymous upload is disabled then it redirects to the login page. If you just want to display an error message instead then do this, in index.cgi put a number sign (#) at the start of lines 431, 432 and 433 like so:
Underneath put:
http://pastebin.com/raw.php?i=QbB7DWb7
Code: Select all
#$ses->redirect("?op=login") if !$c->{enabled_anon} && !$ses->getUser;
#$ses->redirect("?op=login") if !$c->{upload_on} && $utype eq 'anon';
#$ses->message("Uploads are disabled for your user type","Upload error") if !$c->{upload_on};
Code: Select all
$ses->message("To start upload. You must be a registered user. Please <a href=\"$c->{site_url}/?op=registration\">register on the site.</a>") if !$c->{upload_on_anon} && $utype eq 'anon';
http://pastebin.com/raw.php?i=QbB7DWb7