PDA

View Full Version : VB3-Style admin-login


rylin
26 Nov 2002, 23:53
Right..
Just for fun (well, for the looks, really ;)) I took a few minutes to re-write the vb2.2.8 admin-login screen to look like the vb3 preview one.

Note: the code does use images that are copyrighted to jelsoft, so you're *supposed* to use your own, unless jelsoft allow us all to use them :p

Step 1, download the hack (attachment to this post)
Step 2, unzip all the files to your admin/ directory
Step 3, open up global.php (in the admin dir!)
Step 4:
Look for if ($bbuserinfo[userid]==0 and $checkpwd) {
Delete *everything* below it, and paste:
include 'vb3login.php';
cpfooter();
exit;
} // end of if ($bbuserinfo[userid]==0 and $checkpwd)

?>

anyway.. have fun, and enjoy ;)

11/28: Made the username (if it was ever set) appear in the username box automatically.

CeleronXL
27 Nov 2002, 00:11
Thanks!

Btw, that URL should be http://www.vbulletin.com/forum/modcp , not just mod.]

Posting the HTML in the files creates a parse error. O_o

Erwin
27 Nov 2002, 00:18
Hehe...

I don't the images should be a problem, since we are using it with a licensed vB.

Post a demo or screenshot for the ones who would surely ask for one...

Erwin
27 Nov 2002, 00:21
To avoid parse errors when you place HTML in PHP files, make sure you put a \ slash behind every " like this:

<img src\"http://test.com/test.gif\">

Edit: Actually, this doesn't apply to global.php I've just had a look at it, as the HTML is not within php tags.

CeleronXL
27 Nov 2002, 00:31
The parse error is on the line that contains naught but <html>

Erwin
27 Nov 2002, 00:49
Cool... it worked for me. :) Your instructions need to be a bit clearer - what to copy, what to replace etc. But it looks nice. :)

It works for both the Admin and Mod CP logins - for the mod one, just edit the mod global.php in the same way. :)

CeleronXL
27 Nov 2002, 00:51
Eh? Can you post exactly what you have from if ($bbuserinfo[userid]==0 and $checkpwd) { and down?

I was adding "echo "";" tags all the way down and it was working until I got to


echo "<table cellpadding=\"4\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"submitrow\">";

Whereupon it still gives a parse error.

Erwin
27 Nov 2002, 00:59
No, no need to put echo - just cut and paste the HTML code UNCHANGED - no need echo, no need backslash - that bit is not within PHP as the PHP tags have ended. :)

CeleronXL
27 Nov 2002, 01:03
So what does yours read then? Even without the echo's, it does not work. Without the backslashes, it does not work. O_o
Mine reads like this:

if ($bbuserinfo[userid]==0 and $checkpwd) {
echo "<html>";
echo "<head>";
echo "<link rel=\"stylesheet\" href=\"../controlpanel.css\" />";
echo "<title>vBulletin Administrator Control Panel</title>";
echo "</head>";
echo "<body onload=\"document.forms.submitrow.loginusername.focus()\">";
echo "<p>&nbsp;</p><p>&nbsp;</p>";
echo "<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" width=\"450\" align=\"center\" class=\"tborder\"><tr><td>";
echo "<table cellpadding=\"4\" cellspacing=\"0\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td class=\"tcat\" align=\"center\"><b>Please Log In:</b></td>";
echo "</tr>";
echo "</table>";
// <!-- logo and version -->
echo "<table cellpadding=\"4\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"navbody\">";
echo "<tr valign=\"bottom\">";
echo "<td><img src=\"../images/cp/cp_logo.gif\" width=\"160\" height=\"66\" alt=\"cplogo\" title=\"vBulletin &copy;2000-2002 Jelsoft Enterprises Ltd.\" border=\"0\" /></td>";
echo "<td><b><a href=\"../index.php\">Forum Sector</a></b><br />vBulletin v<?php echo $template version ?><br />&nbsp;</td>";
echo "</tr>";
echo "</table>"
// <!-- /logo and version -->
echo "<table cellpadding=\"4\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"submitrow\">";
echo "<tr>";
echo "<td width=\"100\" align=\"right\" class=\"button\"><u>U</u>sername</td>";
echo "<td><input type=\"text\" name=\"loginusername\" value=\"StarCraftSector\" size=\"40\" accesskey=\"u\" /></td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"right\" class=\"button\"><u>P</u>assword</td>";
echo "<td><input type=\"password\" name=\"loginpassword\" size=\"40\" accesskey=\"p\" /></td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan=\"2\" align=\"center\">";
echo "<input type=\"submit\" value=\" Log In \" accesskey=\"s\" />";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</td></tr></table>";
echo "</form>";

echo "</body>";
echo "</html>";
<p align="center"><font size="1">vBulletin v<?php echo $templateversion ?> Administrator Control Panel</font></p>
<?php
cpfooter();
exit;
}

?>

EDIT: Aight, you're not browsing this thread anymore, I take it you did not want to post your code.... O_o

LOD-squa
27 Nov 2002, 01:36
can someone post a way I can understand it better I'm confused and i wanna get this.

Linux
27 Nov 2002, 01:42
I Never seen the VB3-Style admin-login, could you please post a screenshot ?

CeleronXL
27 Nov 2002, 02:01
You can see the vB3 style mod login here: http://www.vbulletin.com/forum/modcp

The admin login looks the same.

Erwin
27 Nov 2002, 02:17
Just a few tips - you need to manually add the table background image to the HTML code to make it look exactly like the vB3 mod cp login.

Also, you need to remove the username from the login text input box.

Ensure you remove all the vB3 <form> and hidden input variables, and replace it with the vB2 ones as well as the PHP code needed in the middle of the HTML code - his instructions don't make it clear.

As the hack author has stated he will support this hack, I will leave the rest to him. :)

countryboy713
27 Nov 2002, 06:15
Step 1, download the vb3 control-panel stylesheet, name it to eg admin/vb3cp.css

where do i download this?

Erwin
27 Nov 2002, 06:34
Another tip - in vB3cp.css, get rid of the references to the background gifs - they don't exist on your server and will slow down the loading of your login page.

rylin
27 Nov 2002, 10:29
Right,
afterif ($bbuserinfo[userid]==0 and $checkpwd) {
it should look like


// cpheader("<title>Forums admin</title>");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type" />
<meta http-equiv="MSThemeCompatible" content="yes" />
<link rel="stylesheet" href="cp2.css" />
<title>vBulletin Moderators' Control Panel</title> <script language="Javascript">

// attempt to rename the frameset title
if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown' && typeof(parent.document.title) == 'str$
{
if (document.title != '')
{
parent.document.title = document.title;
}
else
{
parent.document.title = "vBulletin Community Forum Control Panel";
}
}
</script>
</head>
<body onload="document.forms.submitrow.loginusername.focus()">
<p>&nbsp;</p><p>&nbsp;</p>

<br><br><br>
<form method="post" id="submitrow">
<input type="hidden" name="s" value="<?php echo $session[sessionhash]; ?>">
<input type="hidden" name="action" value="login">
<input type="hidden" name="redirect" value="<?php

if ($HTTP_SERVER_VARS['REQUEST_URI']!="") {
$url = $HTTP_SERVER_VARS['REQUEST_URI'];
} else {
if ($PATH_INFO) {
$url = $PATH_INFO;
} else {
$url = $PHP_SELF;
}

if ($QUERY_STRING) {
$url .= "?$QUERY_STRING";
}
}

$url=ereg_replace("sessionhash=[a-z0-9]{32}&","",$url);
$url=ereg_replace("\\?sessionhash=[a-z0-9]{32}","",$url);
$url=ereg_replace("s=[a-z0-9]{32}&","",$url);
$url=ereg_replace("\\?s=[a-z0-9]{32}","",$url);
echo htmlspecialchars($url);
?>">
<table cellpadding="1" cellspacing="0" border="0" width="450" align="center" class="tborder"><tr><td>
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td class="tcat" align="center"><b>Please Log In:</b></td>
</tr>
</table>
<!-- logo and version -->
<table cellpadding="4" cellspacing="0" border="0" width="100%" class="navbody">
<tr valign="bottom">
<td><img src="cp_newlogo.gif" width="160" height="66" alt="cplogo" title="vBulletin &copy;2000-2002 Jelsoft Enterpr$
<td><b><a href="../index.php">MGOForum</a></b><br />vBulletin Administrators' Control Panel<br />&nbsp;</td>
</tr>
</table>
<!-- /logo and version -->
<table cellpadding="4" cellspacing="0" border="0" width="100%" class="submitrow">
<tr>
<td width="100" align="right" class="button"><u>U</u>sername</td>
<td><input type="text" name="loginusername" value="" size="40" accesskey="u" /></td>
</tr>
<tr>
<td align="right" class="button"><u>P</u>assword</td>
<td><input type="password" name="loginpassword" size="40" accesskey="p" /></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value=" Log In " accesskey="s" />
</td>
</tr>
</table>
</td></tr></table>
</form>
<p align="center"><font size="1">vBulletin v<?php echo $templateversion ?> Administrator Control Panel</font></p>
<?php
cpfooter();
exit;
}

?>

(Note, this was to the actual *end* of the file, in other words, the last } bracket is the end of the if ($bbuserinfo[userid]==0 and $checkpwd) { check)

rylin
27 Nov 2002, 10:43
Now for the urls to stylesheets etc :p
Stylesheet: http://vbulletin.com/forum/clientscript/controlpanel.css
save it as admin/cp2.css
vBulletin logo: http://www.vbulletin.com/forum/images/cp/cp_logo.gif
save it as admin/cp_newlogo.gif
background image 1: http://vbulletin.com/forum/images/cp/cp_colheader_bg.gif
save it as admin/cp_colheader_bg.gif
background image 2: http://vbulletin.com/forum/images/cp/cp_navbody_bg.gif
save it as admin/cp_navbody_bg.gif
background image 3:
http://vbulletin.com/forum/images/cp/cp_tblhead_bg.gif
save it as admin/cp_tblhead_bg.gif

now, the whole thing should look something like the attachment:

camikazi2k
27 Nov 2002, 12:14
ok ok ok
THIS IS WAY TOO CONFUSING
u should put everything in one file and release the hack
thanks

rylin
27 Nov 2002, 12:17
we're not allowed to release whole files though? (eg. vbulletin files) :/

Xenon
27 Nov 2002, 14:16
you can release files you've written yourself, or the instructions here can be put into a file, but you are not allowed to post full vb-files, no matter if you have changed some code in it or not..

rylin
27 Nov 2002, 14:38
Originally posted by Xenon
you can release files you've written yourself, or the instructions here can be put into a file, but you are not allowed to post full vb-files, no matter if you have changed some code in it or not..

Hmm.. right, nice version coming up shortly :D

Floris
27 Nov 2002, 14:51
Was this rewritten at all or just a save as ... file.htm

rylin
27 Nov 2002, 14:54
Originally posted by xiphoid
Was this rewritten at all or just a save as ... file.htm
the login page was ripped straight off, path-names to images & css changed, form-fields changed.
global.php was hacked to simply include() the page

wolfe
27 Nov 2002, 14:59
nice one for attaching that zip :D

The Ghost
27 Nov 2002, 16:47
looks great! thx

*installs*

SZ|TalonKarrde
27 Nov 2002, 17:44
heh...my co-admin messed up and installed it wrong...only he could log in for admin, wouldn't let me in. Uninstalled it, for now.

rylin
27 Nov 2002, 17:47
Originally posted by SZ|TalonKarrde
heh...my co-admin messed up and installed it wrong...only he could log in for admin, wouldn't let me in. Uninstalled it, for now.

did he use the zip file, or did he use the original instructions?
might wanna try the zip

Dean C
27 Nov 2002, 18:21
hehe this is cool

Thanks for sharing it with the community :)

Regards

- miSt

countryboy713
27 Nov 2002, 21:50
can someone explain better how to do this for the mod CP also? i cant find if ($bbuserinfo[userid]==0 and $checkpwd) {

in the global.php in the mod folder

rylin
27 Nov 2002, 21:55
Originally posted by countryboy713
can someone explain better how to do this for the mod CP also? i cant find if ($bbuserinfo[userid]==0 and $checkpwd) {

in the global.php in the mod folder

after a quick look, i believe it should be enough if you follow the above instructions but look for
if (!ismoderator() or !$permissions['canview']) {
instead

also, a few rows after this, you should see

<?php
cpfooter();
exit;
}
you should *not* do anything past that ;)
I'll verify it by fixing on my site.. gimme a few minutes :)

rylin
27 Nov 2002, 21:59
yep, that did it for me.
In other words, you should have the permission-check section look like

if (!ismoderator() or !$permissions['canview']) {
include "vb3login.php";
cpfooter();
exit;
}

// ###################### Start makemodchoosercode #######################


Also, note that you'll have to edit the vb3login.php page if you want to use the same stylesheet & pics for mod & admin panel (basically create absolute paths for them)

Velocd
27 Nov 2002, 22:10
A complete waste of my time just to enhance the aesthetics of the admin panel to appear like vBulletin 3. Which is why I will probably install it. :p

Good job maestro.

/me clicks install.

Link14716
27 Nov 2002, 22:11
/me installs onto Admin and Mod CP's.

And yea, I found that out about the mod pannel too, okidoki, I was actually about to post it, but you beat me to it :)

CeleronXL
27 Nov 2002, 22:19
By the way, it finally worked for me. Thanks okidoki!

/me installed it to the admin and mod panels.

Xenon
27 Nov 2002, 22:28
hmm, you have to say, this hack has no use if you want to hear the truth...

but it's a very nice feeling to see that cp-loginscreen ;)
*installs*

rylin
27 Nov 2002, 22:32
Originally posted by Xenon
hmm, you have to say, this hack has no use if you want to hear the truth...

I can't agree more :p
But hey, it's a two minute job that makes you waste^H^H^H^H^Hspend 5 minutes of your time staring at the pretty screen instead of just logging in :D

Mike Gaidin
28 Nov 2002, 00:29
I wouldn't mind installing this, but it's too much of a pain to follow this thread. Could someone release a good text file of how this should be installed? Thanks.

Erwin
28 Nov 2002, 01:24
Originally posted by J-OST
I wouldn't mind installing this, but it's too much of a pain to follow this thread. Could someone release a good text file of how this should be installed? Thanks.

There is a ZIP file in the first post. :)

Sebastian
28 Nov 2002, 07:11
how do I get it to automatically put my username in the username field like: http://www.vbulletin.com/forum/modcp when I go there is puts my vbulletin.com username in the box and puts the cursor on the password box.

NTLDR
28 Nov 2002, 10:06
Originally posted by Sebastian
how do I get it to automatically put my username in the username field like: http://www.vbulletin.com/forum/modcp when I go there is puts my vbulletin.com username in the box and puts the cursor on the password box.

I will post my version later on if no one has done this. Mine works just like the vB3 one does, adding in your username automatically if its set etc

rylin
28 Nov 2002, 10:16
Originally posted by Sebastian
how do I get it to automatically put my username in the username field like: http://www.vbulletin.com/forum/modcp when I go there is puts my vbulletin.com username in the box and puts the cursor on the password box.

Look for the line that says (in vb3login.php)

<td><input type="text" name="loginusername" value="" size="40" accesskey="u" /></td>


and change it to

<td><input type="text" name="loginusername" value="<?php if(isset($bbuserinfo["username"]) && ($bbuserinfo["username"] != "Unregistered")) { echo $bbuserinfo["username"]; } ?>" size="40" accesskey="u" /></td>

updating zip in a while..

Kars10
28 Nov 2002, 10:38
Cool OkiDoki!!
But can u make that we can use this for the Mod-Login too??
What must i change in the mod-global.php if i would use there the login-screen too?
Thankx!

/me klicks install.

rylin
28 Nov 2002, 10:49
Originally posted by Minifreunde
Cool OkiDoki!!
But can u make that we can use this for the Mod-Login too??
What must i change in the mod-global.php if i would use there the login-screen too?
Thankx!

* Minifreunde klicks install.

I'm going to re-work it slightly to use the same include for admin & mod, stripped down css etc for tonight..
Expect a updated zip in some 12 hours (or less, if i get bored :p :p :p)

Exo
28 Nov 2002, 12:05
any screens? ;)

rylin
28 Nov 2002, 12:08
Originally posted by Exo
any screens? ;)

http://www.vbulletin.org/forum/attachment.php?s=&postid=325989

Sebastian
28 Nov 2002, 17:44
okidoki: That works.. it puts the username in the box, but how do I get the cursor to go to the password field automatically if the username is already filled in?

Kars10
28 Nov 2002, 17:50
Originally posted by Sebastian
okidoki: That works.. it puts the username in the box, but how do I get the cursor to go to the password field automatically if the username is already filled in?

Check this (http://www.vbulletin.org/forum/showthread.php?s=&threadid=43484) Hack by Teck out:

Sebastian
28 Nov 2002, 22:01
Thanks, the admin/global.php already has the code.

Change:

<body onload="document.forms.submitrow.loginusername.focus()">

to:

<body onload="document.forms.submitrow.loginpassword.focus()">


And it will put the cursor on the password field instead.

Sebastian
28 Nov 2002, 22:30
Okay, I added IP/Hostname to it, so at leasts it scares a mice away, or try ;)

After you have applied okidoki's hack.

In admin/global.php

Find:

<input type="hidden" name="s" value="<?php echo $session[sessionhash]; ?>">
<input type="hidden" name="action" value="login">
<input type="hidden" name="redirect" value="<?php

Directly below add:

$ipaddress=iif(getenv("REMOTE_ADDR")!="",getenv("REMOTE_ADDR"),$HTTP_HOST);
$hostname = @gethostbyaddr($ipaddress);


Still in admin/global.php
Find:

<p align="center"><font size="1">vBulletin v<?php echo $templateversion ?> Administrator Control Panel</font></p>


Replace with:

<p align="center"><font size="1">vBulletin v<?php echo $templateversion ?> Administrator Control Panel<br><?php echo $ipaddress ?>@<?php echo $hostname ?> <br><b><font color="#F90824">LOGGED</font></p>


If you really want you can make it log IP/Hostmask to a .txt file or .log file. I will probably end up doing that.
Anyone want to give it a shot? hope you don't mind okidoki ;)

Pic:

rylin
29 Nov 2002, 14:27
Originally posted by Sebastian
Anyone want to give it a shot? hope you don't mind okidoki ;)


I don't mind at all :)

USS Phenix
08 Dec 2002, 00:23
IS there like a Admin CP made to look like vb3?

rylin
08 Dec 2002, 00:44
Originally posted by USS Phenix
IS there like a Admin CP made to look like vb3?

yeah, http://vbulletin.com/forum/admincp ;)

jokes aside - no, only logon :)

Boofo
08 Dec 2002, 01:39
Originally posted by Sebastian
Okay, I added IP/Hostname to it, so at leasts it scares a mice away, or try ;)

If you really want you can make it log IP/Hostmask to a .txt file or .log file. I will probably end up doing that.
Anyone want to give it a shot? hope you don't mind okidoki ;)

Pic:

Any further on the log file? :)

Boofo
08 Dec 2002, 01:59
Sebastian, I can't find any of that code you posted in the admin/global.php. I am running 2.2.9. Can you tell me where it is supposed to be?

Zazz
08 Dec 2002, 10:09
it's in the vb3login.php file.
The instructions he posted are for the old version of the hack.

Boofo
08 Dec 2002, 13:47
Has anyone noticed the problem when clicking a link (to like the following)?

http://www.bearfacts2.com/forum/admin/user.php?action=doips&s=&ipaddress=xx.xxx.xx.xxx

It seems to log on fine and then just goes to a Done page with background color and nothing else. There is normally an IP address in there, but I replaced it with x's.

Xenon
08 Dec 2002, 13:53
Originally posted by USS Phenix
IS there like a Admin CP made to look like vb3?

you can always modify cp.css to look like vb3 and then change a view images :)

but released? no, there you ahve to wait for vb3 ;)

Bison
08 Dec 2002, 17:54
I'll give this a try ... looks good from a visual standpoint.

Kohhal
09 Dec 2002, 10:52
Originally posted by USS Phenix
IS there like a Admin CP made to look like vb3?
Yes, http://www.vbulletin.com/forum/showthread.php?threadid=60376

drives fast
13 Dec 2002, 03:44
why exactly does this hack require a seperate php script?

the html in the global.php can be edited and get the same result without it

Keyser Söze
14 Dec 2002, 00:23
ok, i installed this, works fine, but is the only thing new/diffrent the login screen?

wats the point of that

Xenon
14 Dec 2002, 22:40
yes it's the only thing, that's the hack

what's the point?
you should know why you installed it....

Boofo
14 Dec 2002, 23:31
Did anyone ever figure out when you click on an IP link (to check it) that it goes to a blank screen instead of the IP listing with this hack?