Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorbluejob
     
    hi there, i'm still new with php frameworks and am still trying to get a hang of things...i'd like to make sort of a registration view. my problem is how do i get a password textfield, when i made the scaffolding(add, edit, etc), i tried to just change the "add" view to the registration and wanted to add a password field, the partial "form" template has this for the password item in the DB:

    <?php echo $active_record_helper->input('member', 'memberPassword')?>

    how do i edit that so that it'll be a password field instead of a normal input textfield?

    by the way, can anyone also add how to add the password field using sintags?


    thanks.
    • CommentAuthorKaste
     

    the active_record_helper returns a password field automatically if

    strstr($column_name,'password') === true
    

    thats case-sensitive, though, so 'member_password' or simply 'password' should work.

    I don't think you could set any options here. You could use the _form_helper_in case you can't rename the column.

    (Any arguments against patching this to use stristr? Anyone?)

    • CommentAuthorbluejob
     
    thanks a lot for the info...man, i really need to brush up on this.
    do you have any tips or how-tos on how to make a login screen?
    • CommentAuthorsuthern
     
    Ok, so how do we modify how this value is saved in the database?

    Right now it is saved DIRECTLY into the database (in plain text). What if I'd like to save and check it using MD5 or MySQL's PASSWORD? Where and what would I add in the model? (assuming the field is called 'password')

    Thanks!
    • CommentAuthorinsanet
     

    hi suthern, why dont you use beforeSave ?

    function beforeSave(){
      $this->password = md5($this->password);
      return true;
    }
    

    NOTE: all methods like beforeSave,beforeUpdate,afterCreate,after... etc..., need to return true or false.

    • CommentAuthorsuthern
     
    Ah, that makes sense. :-) Thanks!
    • CommentAuthorsuthern
     

    One more question on this subject. My system is setup so that a user only needs to click on a name, and then type in the password.

    The funny thing is, by the time they get to the password screen the field is already filled in.

    &lt;?php echo $form_helper->password_field('person', 'password', array("value" => '')) ?> does not set the value to blank. The value remains that of the users password, which is really very useless. Why have a password field if the data is already typed in? (storing as plaintext. heh)

    What's the akelos way to fix this? can I FORCE the value to be blank? I know I can write my own simple little helper to put a normal textfield with the correct name, but I was curious what you guys would do.