Skip to content

Instantly share code, notes, and snippets.

@fritids
Created October 1, 2015 21:25
Show Gist options
  • Select an option

  • Save fritids/23380efb5efaf82b625c to your computer and use it in GitHub Desktop.

Select an option

Save fritids/23380efb5efaf82b625c to your computer and use it in GitHub Desktop.

Revisions

  1. @andrewtch andrewtch created this gist Jul 2, 2013.
    29 changes: 29 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    <?php

    function login_test($username, $password)
    {
    if ($username == $password) {

    mysql_connect('localhost', 'root');
    mysql_select_db('phpbb');

    $exists = mysql_num_rows(mysql_query('SELECT * FROM '.USERS_TABLE.' WHERE username = \''.$username.'\'')) == 1;
    return array(
    'status' => $exists ? LOGIN_SUCCESS : LOGIN_SUCCESS_CREATE_PROFILE,
    'error_msg' => '',
    'user_row' => array(
    'user_id' => 7,
    'username' => $username,
    'user_password' => '',
    'user_email' => '[email protected]',
    'group_id' => 0,
    'user_type' => USER_NORMAL
    )
    );
    }
    }

    function validate_session_test($user_row)
    {
    return true;
    }