Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Themes
Author Message
spcdata
Regular
Regular


Joined: Jan 24, 2004
Posts: 81
Location: Sweden

PostPosted: Sat Sep 25, 2004 3:21 am Reply with quote

Hi Smile

I neeed help with one thing, i have the loginbox in the header it works fine but when i'm logged in as normal user i can't login as admin? Crying or Very sad

I redirects to the page that says that there is no corresponding user info was found?

What is it i'm missing? hope someone can help me with this.

Here is the code from my header:

Code:
echo "<form action=\"account.html\" method=\"post\">\n";

    if (is_user($user)) {
    $username = $cookie[1];
    echo ""._BWEL."! <b>$username</b>&nbsp;&nbsp;<a href=\"modules.php?name=Your_Account&amp;op=logout\">"._LOGOUT."</a>&nbsp;\n";
    } else {
    echo "<input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\">\n";
    echo "<input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\">&nbsp;<input type=\"submit\" value=\""._LOGIN."\">&nbsp;\n";
          echo "<input type=\"hidden\" name=\"redirect\" value=$redirect>\n";
          echo "<input type=\"hidden\" name=\"mode\" value=$mode>\n";
          echo "<input type=\"hidden\" name=\"f\" value=$f>\n";
          echo "<input type=\"hidden\" name=\"t\" value=$t>\n";
          echo "<input type=\"hidden\" name=\"op\" value=\"login\">\n";
          echo "</td>\n";
          echo "</form></td></tr>\n";
          }

_________________
/spcdata 
View user's profile Send private message Send e-mail Visit poster's website
spottedhog
Regular
Regular


Joined: Jun 02, 2004
Posts: 88

PostPosted: Sat Sep 25, 2004 7:39 am Reply with quote

apples and oranges..... Smile

You are talking about doing 2 different tasks using the same input form, which cannot be done.

In other words, you need to log in as admin using the admin.php script, not the Your_Account module.
 
View user's profile Send private message Visit poster's website
spcdata
PostPosted: Sat Sep 25, 2004 8:05 am Reply with quote

But that is just the way i do, I login as normal user through the Your_Account, then I go to login through admin.php as i usualy do and that don't work...

But if I log in as the admin (through admin.php) first and as normal user after, it works strange..?

When I had the login-block there where no problem so I suppose the problem has to do with the header...but I don't know what Question

Anyway Thanks for Your answer Very Happy
 
spcdata
PostPosted: Sat Sep 25, 2004 8:34 am Reply with quote

Very Happy I think i found the answer.

Here it is:
Code:
if (is_user($user) AND $cookie[1] == "$username" AND is_admin($admin)) {


i tried some other combinations but not this one, so now it works

(have not found any problems with it yet) Wink
 
spcdata
PostPosted: Sat Sep 25, 2004 10:04 am Reply with quote

I found one problem.... Rolling Eyes

The login part is working with both admin and as normal user, but now the login box is remaining....the logout link will not show up so I can't logout ??

what could it be that i'm missing here??

Could someone help me with this Please.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Themes

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©