This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
tsmac/application/classes/Model/Account.php

29 lines
746 B
PHP
Raw Normal View History

2014-10-08 12:17:00 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Acconunt Model
*
* @package TSM Access Management
* @category Models
* @author Deon George
* @copyright (c) 2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Model_Account extends lnApp_Model_Account {
protected $_has_many = array(
'ssl'=>array('model'=>'SSL','far_key'=>'id','foreign_key'=>'account_id'),
);
public function id() {
if (! $this->prefix)
throw HTTP_Exception::factory(501,'Your prefix is missing, please contact an admin');
return strlen($this->prefix) > 1 ? $this->prefix : sprintf('%s%06d',$this->prefix,$this->id);
}
2014-10-09 12:23:02 +00:00
public function ssl_dn() {
return sprintf('O=IBM,CN=%s',$this->id());
}
2014-10-08 12:17:00 +00:00
}
?>