51seven / Customer-Key-Chain

Customer Management tool.
0 stars 0 forks source link

Combination beforeSave() won't work #32

Closed timomeh closed 10 years ago

timomeh commented 10 years ago

I've changed the beforeSave() hook of the Combination model. If no http:// is found in the loginurl it should be prepended. Looks like this:

public function beforeSave($options = null) {

    parent::beforeSave(); 

    if(isset($this->data['Combination']['loginurl']) && (strpos($this->data['Combination']['loginurl'], "http://") !== false)) {
        $this->data['Combination']['loginurl'] = 'http://' . $this->data['Combination']['loginurl'];
    }

    return true;
}

If I create a combination with a loginurl without http:// it should be there, but it isn't. wat