Sitebase

Sitebase does not currently provide support for this item.

47 comments found.

Hello, I just bought your login system. I am not a coder and I don’t understand how to use it. I just want to insert the login form in my html page and use a xml file. Would you mind sending me a simple tutorial or an example? Thanks a lot.

You can use this script only on a PHP website.

Bought it yesterday, but i’m a bit lost on the use of it too… :)

Would be very nice if we could get some quick installation help on this one… :)

I included a documentation file and 7 examples. Take a look at the loginform example, this is a good example of how to use this script in a website.

is it possible to implement this login class to the codeigniter framework?

or is it better wo write your “own” codeigniter login?

This is indeed possible :).

Hi,

I am looking for a login form that I can use as a redirect. I have hosting through a shared host, and need a login script that I can add to my website that will allow my clients to login via my site, and visit their email account through my host (I want to bypass my hosts email landing page that is branded to them, and go straight to the squirrel mail account. Is this possible with your script?

To do something like this you need a custom script. Contact me if you want to know more about this.

Could you provide a sample code snippet that I would need to include on a regular page to check whether a user is logged in?

I’m trying to have your login script check against a WHMCS database. They use a hash/salt sequence as follows.

$enc_password = $data['password'];
$salt = substr($enc_password,-5,5);
if ( md5($salt.$entered_password).":$salt" !== $enc_password )
{
return false;
}
else
{
// do login
}

Found here

Here’s what I’ve got, but it’s basically ending on a white page with no status of anything that happened. Just an empty white page. Not sure what I’m doing wrong. I am basically trying to get yours working with their hash method to verify a password/email match (in this case, “email” is the username).

Yes, the remote host was enabled in cPanel to allow this IP address ;-)

    $Login = new Login();
    $Login->InitDatabase("my-remote-hostname", "my-username", "my-password", "my-database", "my-table", "email", "password");
    $Login->SetPasswordEncoder("myhash");
    $salt = substr($enc_password,-5,5);

    // Custom password encoder
    function myhash($password, $fields){
        global $_POST;
        return md5($salt.$_POST['txtpassword']).":$salt";
    }

    if($Login->Test($_POST['txtusername'], $_POST['txtpassword'])){
        echo "Correct";
    }else{
        $login_error = true;
        echo "Incorrect";
    }

Any help is appreciated. Thank you.

Begging for some help here. Thanks.

I think in this case it’s better to contact the people from cPanel because I’m not familiar with cPanel :)

I uploaded all the files to my server and keep getting this error message when I try to log in:

Parse error: syntax error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’

It says the error is on line 30

Is there something that with need to change with the const?

I’m sorry, I’m not great at PHP and I’ve used up all my resources.

You have PHP4 installad on your server and for this script you need at least PHP5 .x Try to contact your hosting provider and ask him if it’s possible to enable PHP5 .

not sure which example to use. I have a mysql database with username and password which do i use and how do i implement. can you email me the appropriate code

You can use the Mantis example. This is using a database and a MD5 hash as password.

hi , I’m trying to implement this in wordpress, but I don’t know if I’m implementing it the correct way.

Let me explain what I do..

I put Login.php and class-phpass.php in root folder

I add this to my category.php and taxonomy.php:

<?php include("private/Login.php");
include("private/class-phpass.php");

$Login = new Login();
$Login?>InitDatabase("mydb", "mydb_user", "mydb_pass", "mydb_db", "wp_users", "user_login", "user_pass");
$Login->SetPasswordEncoder("wordpress_hash");
if($Login->Test("Locke", "mypass")){
    echo "Login ok";
}else{
    echo "Login fout";
}

// Hash that is used for passwords
function wordpress_hash($password, $fields){
    $wp_hasher = new PasswordHash(8, TRUE);
    //echo $wp_hasher->HashPassword($password) . "<br />";
    if($wp_hasher->CheckPassword($password, $fields->user_pass)){
        return $fields->user_pass;
    }
    return false;
}
// If action is set to logout then reset the session
// and refresh the page
if(isset($_GET['action']) && $_GET['action'] == "logout"){
    session_destroy();
    header("Location: index.php");
}

?&gt;

below:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>

<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<title>Easy login class</title>
<link href="&lt;?php bloginfo('url'); ?&gt;/private/style.css" rel="stylesheet" media="screen" />
</head>
<body>

<div id="wrapper">
    &lt;?php if(empty($_SESSION['user'])){ ?&gt;
        <div class="header">
            <h2>Login form</h2>
        </div>
        <div class="content">
            <form enctype="application/x-www-form-urlencoded" name="frmlogin" method="post" action="" id="frmlogin">
                <label>Username</label>
                <input &lt;?php if($login_error) echo 'class="error"'; ?&gt; id="txtusername" name="txtusername" type="text" />
                <label>Password</label>
                <input &lt;?php if($login_error) echo 'class="error"'; ?&gt; id="txtpassword" name="txtpassword" type="password" />
                <button id="btnlogin" type="submit">Try to login</button>
            </form>
        </div>
</div></body><body>
</body></html>

then :

&lt;?php }else{ ?&gt;

below:

&lt;?php get_header(); ?&gt;

<section class="content">

<h2>Welcome &lt;?php echo $_SESSION['user']; ?&gt;</h2>
<p><a href="?action=logout">Click here</a> to logout</p>

<ul id="article_filter">
<li class="current"><a href="#">Todos</a></li>

<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
</ul>
<ul id="article"> 
&lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;

    <li class="all &lt;?php the_term_name('filter'); ?&gt;"> 
     &lt;?php the_jewel(); ?&gt;
    </li>

 &lt;?php endwhile; else: ?&gt;
 <p>Sorry, no posts matched your criteria.</p>
 &lt;?php endif; ?&gt;

 </ul>
 </section>

&lt;?php get_footer(); ?&gt;

then I close :

<?php } ?>

I know this doesn’t work hahaha.

Do you know how to solve this???

Can you send me an email with a zip of your php files that your are using.

Hey,

I get the following error when i try to use this with WHMCS

Warning: This encoding function can’t be used. in /path/Login.php on line 155 Incorrect

Currently my code looks like this..

session_start();
$login_error = false;

if(isset($_POST['username'])){

include("/path/Login.php");
include("/path/SessionLogin.php");

$Login = new SessionLogin();
    $Login->InitDatabase("localhost", "db_user", "pass", "db_name", "table", "email", "password");
    $Login->SetPasswordEncoder("myhash");
    $salt = substr($enc_password,-5,5);

    // Custom password encoder
    function myhash($password, $fields){
        global $_POST;
        return md5($salt.$_POST['password']).":$salt";
    }

    if($Login->Test($_POST['username'], $_POST['password'])){
        echo "Correct";
    }else{
        $login_error = true;
        echo "Incorrect";
    }
}

Place your encoding function below you includes and before $Login = new … That will fix this problem.

Hello,

Now i get the following error

Catchable fatal error: Object of class stdClass could not be converted to string in PATH on line 15

Line 15 is the following.

return $salt.$_POST[‘password’].”:$salt”;

Any idea why this wouldn’t work?

Hello, I want to use it with my database;

1) Does it redirect to my secure page after login?

- index.php Login

- members.php secure page

2) Does it protect folder against who are not logged in?

Who want to reach directly members.php

3) Does your login form work like this or do I need to make modifications?

4) Will you help me with that?

Thanks

I have included a example included in this script (loginform) and that is exactly what you need. After login the user gets redirected to an other protected page.

To see how it works with databases you can look at the Wordpress, Mediawiki and Mantis code examples included.

Basic support is free but for modifications I have to ask some extra money.

If I buy this, is there an example of setting it up using WordPress?

Also, is it straight forward to set it up using WordPress?

There is indeed a Wordpress example included in the download.

Just so I can be clear, would this script allow users to use the same login credentials for lets say 5 different wordpress sites? If this is the case it would a seriously awesome thing, please let me know

Yes, this is possible. Keep in mind that this is a class so you will need to code the MySQL connections to the different databases yourself.

hi dude! this script is protected against account sharing?

Can you explain? What do you understand under account sharing.?

two or more simultaneous login from different pc / browser / ip

ps. reported by mistake : )

It’s not protected against that. No problem about the reporting :).

Hi, can this be used for a Drupal CMS site?

It’s a PHP class so you can use it in all kinds of php websites.

This looks really awesome!

What I am needing is a contact form that depending on which username is put in, it takes the user to a designated page.

Each of these pages will be city related, so users in that city will all use a the same login to access their city’s page. Is there an area were you can specify the URL of the landing page once a specific user logs in? Thanks!

That’s is possible with this script. Keep in mind that this is a PHP class so some PHP knowledge is required.

can you give me a short description how to implement this class to codeigniter?

this would be awesome

Sorry but I don’t have experience with code igniter.

Has anyone got this code to work? If so would you mind sharing how you have implemented it? I have a php site the I want to add simple protection to, but I can not wrap my mind around how to use this script. And the documentation is unclear (to me) and I have only been able to get one of the code samples to work (loginform) But this is not what I need.

Do you get any error when you test the code? Keep in mind that for the WordPress example and so you need to tell the script what database to use.

by
by
by
by
by
by