if ( is_user_logged_in() )
{
if ($current_user->user_login == ‘admin’ || $current_user->user_lastname == ‘Editor’ || !($pos5===false) ) {
echo (‘<hr><b><u>UPLOAD Operation:</b></u></br><font size=”2″>Please specify folder before you upload. Root folder is \’CalSig\’.<br>To upload file into sub folder, select Root folder first, and then select the sub folder.</br>Max upload speed supported is 2MB/s.</br><u>It is recommended to use a ZIP file if you wsih to upload multiple files.</u></font>’);
echo do_shortcode(‘[fileup manager=”on” boxtheme=”yang” makedir=”true” directories=”on” base=2 sub=”CalSig” maxsize=”500″ maxsizetype=”m” uploadlabel=”UPLOAD”]’);
echo (‘</br>[maxbutton id=”1″]</font><hr><b><u>CURRENT File(s) on RSE portal:</b></u></br>To Upload file(s), use the upper section.</br>To add new folder, click “+ new”‘);
if ($current_user->user_lastname == ‘Editor’)
echo do_shortcode(‘[fileaway type=”table” manager=”on” customdata=”Uploaded By” directories=”on” base=2 sub=”CalSig” name=”‘ . $current_user->user_login . ‘” ]’);
else
echo do_shortcode(‘[fileaway type=”table” customdata=”Uploaded By” directories=”on” base=2 sub=”CalSig” name=”‘ . $current_user->user_login . ‘” ]’);
}
else {
echo (‘<hr>’);
echo do_shortcode(‘[fileaway directories=”on” base=2 sub=”CalSig” name=”‘ . $current_user->user_login . ‘” showto=”subscriber”]’);
}
}
else {
echo (‘Only registered user can view the content’);
}
[/PHP]
——————end code ——————————–
good luck
]]>You might consider doing the logged in check right on the responsible template. You cannot do a PHP redirect from there, but a JS one will work. Or display a link to the login page with a redirect_to parameter leading back to the current page. The code would be very similar to the code that checks if the post is password protected and conditionally displays an input field. Just a thought, using template_redirect is fine too.
]]>