TankAuth + FuelCMS

edited September 2015 in Installation
Hi there,

I have installed TankAuth with FuelCMS and I am experiencing the following problem:

Severity: Warning Message: Cannot modify header information - headers already sent by (output started at /customers/9/3/8/mysite.com/httpd.www/cms/fuel/codeigniter/core/Exceptions.php:186) Filename: libraries/Session.php Line Number: 689

as well as:

Severity: Warning Message: Cannot modify header information - headers already sent by (output started at /customers/9/3/8/mysite.com/httpd.www/cms/fuel/codeigniter/core/Exceptions.php:186) Filename: helpers/MY_url_helper.php Line Number: 397

I just can not figure out what is wrong? Has anyone experience with using TankAuth + FuelCMS?

Thanks,

Wilhelmus

Comments

  • edited 10:24AM
    That seems to say that there is output perhaps a space or return at the top of a file.
  • Yes, Tank_Auth does work - I use it. It did some knocking into shape though
  • edited 10:24AM
    At the top of the file? So looking at the line number won't do?
  • edited 10:24AM
    @almostcompletely: can you remember what and where you knocked? :D
  • edited 10:24AM
    Ok, I will just add successively all the lines that need to be changed for TankAuth to work with fuel cms.

    First you need to change the logout function:

    function logout() { $this->delete_autologin(); // See http://codeigniter.com/forums/viewreply/662369/ as the reason for the next line $this->ci->session->set_userdata(array('user_id' => '', 'username' => '', 'status' => '')); $this->ci->session->sess_destroy(); $this->ci->session->sess_create(); }

    This is necessary in order to be able to active accounts e.g. by clicking on the link in the registration email.
  • edited September 2015
    Alright, I fixed it. The second modification needs to be done to the CI/Core/Exceptions.php. Just replace the function show_php_error() with

    function show_php_error($severity, $message, $filepath, $line) { $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity]; $filepath = str_replace("\\", "/", $filepath); // For safety reasons we do not show the full file path if (FALSE !== strpos($filepath, '/')) { $x = explode('/', $filepath); $filepath = $x[count($x)-2].'/'.end($x); } if (ob_get_level() > $this->ob_level + 1) { ob_end_flush(); } ob_start(); include(APPPATH.'errors/error_php.php'); $buffer = ob_get_contents(); echo $buffer; ob_end_clean(); }

    For further information see:
    http://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php
  • edited 10:24AM
    Hi, I am currently working on a model to show the user table in fuel cms backend and create new users. This ist not to hard. However when it comes to saving the password I am experiencing a little problem. The password (12369874 for testing reasons only) needs to be encoded and saved as a hash value. Tank Auth provides a function to do so, which need to be included first. So I added

    require_once(FUEL_PATH.'../../application/libraries/phpass-0.1/PasswordHash.php');

    to my model at the top. However

    $hasher = new PasswordHash( $this->ci->config->item('phpass_hash_strength', 'tank_auth'), $this->ci->config->item('phpass_hash_portable', 'tank_auth')); // hash password $hashed_password = $hasher->HashPassword('12369874');

    doesn't work and results in the following error:

    Fatal error: Call to a member function item() on null in /customers/9/3/8/mysite.com/httpd.www/cms/fuel/application/models/users_model.php on line 39 which equals:

    $this->ci->config->item('phpass_hash_strength', 'tank_auth'),

    What might be causing this problem? I understand that the configuration for hashing can not be loaded because the function item() doesn't receive a value but I copied the exact same lines from PasswordHash.php.

    Thanks for you help,

    Wilhelmus

    PS: I will post my full model here, once it is debugged, so other can use TankAuth with FuelCMS
Sign In or Register to comment.