Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Very simple blog application
  • Hi,

    I've create a very simple blog application with FuelPHP. For all those who want to discover the framework.

    Features :
    • Usage of ORM Model and relationship
    • Usage of SimpleAuth for Authentification
    • Usage of Cache class and HMVC Request for the sidebar
    • Usage of Pagination class
    • Usage of Fieldset class for form (post and comment)
    • Usage of Router class for all links
    • Usage of Theme class
    • Usage of Markdown class
    • Usage of translation files
    • Usage of migration files

    The idea and guideline comes from the project BlogMVC https://github.com/Grafikart/BlogMVC

    The github project of FuelPHP BlogMVC : https://github.com/jhuriez/fuelphp-blogMVC
  • Cool!

    I'm definitely going to find the time to install it, and have a look.

    And maybe add it to the "example applications" section of the tutorials page in the docs?
  • Thanks, i will do a pull request for add it in docs
  • nice work !
  • This blogs works great thank, I was even able to plugin a calendar widget to practice hmvc. Then I tried changing over to Ormauth, but after doing the migration fuelphp gets confused and tries to lookup user in for in the "user" table and not the "users" table. The model is configured for users table. Thank you very much.
  • Because it doesn't use Auth for user management, it uses it's own custom solution using the User model in ./fuel/app/classes/model/user.php.
  • Genius! That was too easy Harro, thanks a million.
  • public function action_resetpassword()
    {
    // If not logged in redirect to home
    if (!\Auth::check())
    {
    \Messages::info(__('user.login.not-logged'));
    \Response::redirect_back();
    }
    // was the login form posted?
    if (\Input::method() == 'POST')
    {
    // check the credentials.
    if (\Auth::instance()->login(\Auth::get_email(), \Input::param('password')))
    {
    if ( !(\Input::param('new_password') === \Input::param('confirm_password')) )
    {
    \Messages::success(__('user.login.mismatch-password'));
    }
    \Auth::change_password(\Input::param('password'),\Input::param('new_password'));
    // inform the user the password change was successful
    \Messages::success(__('user.login.changed'));
    }
    else
    {
    // login failed, show an error message
    \Messages::error(__('user.login.failure'));
    }
    }
    // display the password reset page
    $this->theme->set_partial('content', 'user/resetpassword');
    }


    <?= \Form::open(array('class' => 'form-signin form-reset-password')); ?>
    Reset your password
    ">
    ">
    ">

    <?= \Form::close(); ?>

  • // Form to reset password
    'form-reset-password')); ?>
    Reset your password
    " type="password">
    " type="password">
    " type="password">

  • Oops! Forget to put password reset code inside the check for matching passwords. here is the revised version. Test test tes. Also you have to update the login array for messages

    public function action_resetpassword()
    {
    // If not logged in redirect to home
    if (!\Auth::check())
    {
    \Messages::info(__('user.login.not-logged'));
    \Response::redirect_back();
    }
    // was the login form posted?
    if (\Input::method() == 'POST')
    {
    // check the credentials.
    if (\Auth::instance()->login(\Auth::get_email(), \Input::param('password')))
    {
    if ( !(\Input::param('new_password') === \Input::param('confirm_password')) )
    {
    \Messages::success(__('user.login.mismatch-password'));
    \Auth::change_password(\Input::param('password'),\Input::param('new_password'));
    // inform the user the password change was successful
    \Messages::success(__('user.login.changed'));
    \Response::redirect_back();
    }
    }
    else
    {
    // login failed, show an error message
    \Messages::error(__('user.login.failure'));
    }
    }
    // display the password reset page
    $this->theme->set_partial('content', 'user/resetpassword');
    }
  • // check the credentials.
    if (\Auth::instance()->validate_user( \Auth::get_email(), \Input::param('password') ))
    {
    if ( \Input::param('new_password') === \Input::param('confirm_password') )
    {
    \Auth::change_password(\Input::param('password'),\Input::param('new_password'));
    // inform the user the password change was successful
    \Messages::success(__('user.login.changed'));
    \Response::redirect_back();
    }
    \Messages::success(__('user.login.mismatch-password'));
    }
    else
    {
    // login failed, show an error message
    \Messages::error(__('user.login.failure'));
    }
  • Assuming this is a modication of that code, isn't it a lot easier to send the author a pull request on Github?
  • Yes i don't understand what you want to do. Please send a pull request on github
  • Ok sorry I will send a pull request on GitHub

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion