本文整理汇总了PHP中Configurations类的典型用法代码示例。如果您正苦于以下问题:PHP Configurations类的具体用法?PHP Configurations怎么用?PHP Configurations使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Configurations类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* getting default list
*
* @param string $httpData->PRO_UID (opional)
*/
public function index($httpData)
{
global $RBAC;
$RBAC->requirePermissions('PM_SETUP_ADVANCE');
G::LoadClass('configuration');
$c = new Configurations();
$configPage = $c->getConfiguration('additionalTablesList', 'pageSize', '', $_SESSION['USER_LOGGED']);
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
$this->includeExtJS('pmTables/list', $this->debug);
$this->includeExtJS('pmTables/export', $this->debug);
$this->setView('pmTables/list');
//assigning js variables
$this->setJSVar('FORMATS', $c->getFormats());
$this->setJSVar('CONFIG', $Config);
$this->setJSVar('PRO_UID', isset($_GET['PRO_UID']) ? $_GET['PRO_UID'] : false);
$this->setJSVar('_PLUGIN_SIMPLEREPORTS', $this->_getSimpleReportPluginDef());
if (isset($_SESSION['_cache_pmtables'])) {
unset($_SESSION['_cache_pmtables']);
}
if (isset($_SESSION['ADD_TAB_UID'])) {
unset($_SESSION['ADD_TAB_UID']);
}
//render content
G::RenderPage('publish', 'extJs');
}
示例2: updatePageSize
function updatePageSize()
{
G::LoadClass('configuration');
$c = new Configurations();
$arr['pageSize'] = $_REQUEST['size'];
$arr['dateSave'] = date('Y-m-d H:i:s');
$config = array();
$config[] = $arr;
$c->aConfig = $config;
$c->saveConfig('skinsList', 'pageSize', '', $_SESSION['USER_LOGGED']);
echo '{success: true}';
}
示例3: getStatusCodesConfiguration
/**
* @param $config_file could be specified only the first time (due to option constructor of singleton)
*/
public static function getStatusCodesConfiguration($config_file = '')
{
if (empty($config_file) && !file_exists($config_file)) {
$config_file = SETUP_DIRECTORY . '/../config/status.sample.json';
}
return Configurations::getInstance()->getConfiguration(self::KEY_STATUS_CONFIGURATION, $config_file);
}
示例4: loadModel
/**
* Returns the data model based on the primary key given in the GET variable.
* If the data model is not found, an HTTP exception will be raised.
* @param integer $id the ID of the model to be loaded
* @return Configurations the loaded model
* @throws CHttpException
*/
public function loadModel($id)
{
$model = Configurations::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
示例5: LookForChildren
/**
* departments_Ajax.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
function LookForChildren($parent, $level, $aDepUsers)
{
G::LoadClass('configuration');
$conf = new Configurations();
$oDept = new Department();
$allDepartments = $oDept->getDepartments($parent);
$level++;
$rows = array();
foreach ($allDepartments as $department) {
unset($depto);
$depto['DEP_TITLE'] = str_replace(array("<", ">"), array("<", ">"), $department['DEP_TITLE']);
$depto['DEP_STATUS'] = $department['DEP_STATUS'];
if ($department['DEP_MANAGER_USERNAME'] != '') {
$depto['DEP_MANAGER_NAME'] = $conf->usersNameFormat($department['DEP_MANAGER_USERNAME'], $department['DEP_MANAGER_FIRSTNAME'], $department['DEP_MANAGER_LASTNAME']);
} else {
$depto['DEP_MANAGER_NAME'] = '';
}
$depto['DEP_TOTAL_USERS'] = isset($aDepUsers[$department['DEP_UID']]) ? $aDepUsers[$department['DEP_UID']] : 0;
$depto['DEP_UID'] = $department['DEP_UID'];
$depto['DEP_MANAGER'] = $department['DEP_MANAGER'];
$depto['DEP_PARENT'] = $department['DEP_PARENT'];
if ($department['HAS_CHILDREN'] > 0) {
$depto['children'] = LookForChildren($department['DEP_UID'], $level, $aDepUsers);
$depto['iconCls'] = 'ss_sprite ss_chart_organisation';
$depto['expanded'] = true;
} else {
$depto['leaf'] = true;
if ($level == 1) {
$depto['iconCls'] = 'ss_sprite ss_chart_organisation';
} else {
$depto['iconCls'] = 'ss_sprite ss_plugin';
}
}
$rows[] = $depto;
}
return $rows;
}
示例6: sendEmail
/**
* Sends an email with a link, for resetting the password.
*
* @return boolean whether the email was send
*/
public function sendEmail()
{
/* @var $user User */
$user = User::findOne(['status' => User::STATUS_ACTIVE, 'email' => $this->email]);
if ($user) {
if (!User::isPasswordResetTokenValid($user->password_reset_token)) {
$user->generatePasswordResetToken();
}
if ($user->save()) {
$admin_email = Configurations::find()->where(['key' => 'admin_email'])->one();
return \Yii::$app->mailer->compose(['html' => 'passwordResetToken-html', 'text' => 'passwordResetToken-text'], ['user' => $user])->setFrom($admin_email->value)->setTo($this->email)->setSubject('Password reset for ' . \Yii::$app->name)->send();
}
}
return false;
}
示例7: actionIndex
public function actionIndex()
{
//to hide welcome message - Rajith
if (isset($_POST['hide'])) {
//permanant hide
if (isset($_POST['dontshow'])) {
$config = Configurations::model()->findByAttributes(array('id' => 21));
if ($config != NULL) {
$config->config_value = 1;
$config->save();
}
}
$this->redirect(array('/mailbox'));
}
//check
$config = Configurations::model()->findByAttributes(array('id' => 21));
if ($config != NULL) {
if ($config->config_value) {
$this->redirect(array('/mailbox'));
}
}
$this->render(Yii::app()->getModule('message')->viewPath . '/index');
}
示例8: Publisher
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
if ($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
//G::header('location: ../login/login');
die;
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'setup';
$G_ID_MENU_SELECTED = 'SETUP';
$G_ID_SUB_MENU_SELECTED = 'CALENDAR';
$G_PUBLISH = new Publisher();
G::LoadClass('configuration');
$c = new Configurations();
$configPage = $c->getConfiguration('skinList', 'pageSize', '', $_SESSION['USER_LOGGED']);
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('setup/skinList', false);
//adding a javascript file .js
$oHeadPublisher->addContent('setup/skinList');
//adding a html file .html.
$oHeadPublisher->assign('CONFIG', $Config);
$oHeadPublisher->assign('SYS_SKIN', SYS_SKIN);
$oHeadPublisher->assign('SYS_SYS', "sys" . SYS_SYS);
$oHeadPublisher->assign('FORMATS', $c->getFormats());
G::RenderPage('publish', 'extJs');
die;
global $RBAC;
$access = $RBAC->userCanAccess('PM_SETUP');
示例9: actionAjax_delete
public function actionAjax_delete()
{
$id = $_POST['id'];
$deleted = $this->loadModel($id);
$deleted_batch_id = $deleted->batch_id;
// Saving the id of the batch that is going to be deleted.
if ($deleted->delete()) {
//Adding activity to feed via saveFeed($initiator_id,$activity_type,$goal_id,$goal_name,$field_name,$initial_field_value,$new_field_value)
ActivityFeed::model()->saveFeed(Yii::app()->user->Id, '13', $deleted_batch_id, ucfirst($deleted->name), NULL, NULL, NULL);
// For SMS
$sms_settings = SmsSettings::model()->findAll();
$to = '';
if ($sms_settings[0]->is_enabled == '1' and $sms_settings[5]->is_enabled == '1') {
// Checking if SMS is enabled.
$students = Students::model()->findAll("batch_id=:x", array(':x' => $deleted_batch_id));
//Selecting students of the batch
foreach ($students as $student) {
if ($student->phone1) {
// Checking if phone number is provided
$to = $student->phone1;
} elseif ($student->phone2) {
$to = $student->phone2;
}
if ($to != '') {
// Sending SMS to each student
$college = Configurations::model()->findByPk(1);
$from = $college->config_value;
$message = $deleted->name . ' is cancelled';
SmsSettings::model()->sendSms($to, $from, $message);
}
}
}
// End For SMS
// Delete Exam and exam score
$exam = Exams::model()->findAllByAttributes(array('exam_group_id' => $id));
//print_r($exam);
foreach ($exam as $exam1) {
$examscore = ExamScores::model()->findAllByAttributes(array('exam_id' => $exam1->id));
foreach ($examscore as $examscore1) {
$examscore1->delete();
}
$exam1->delete();
}
// End Delete Exam and exam score
echo json_encode(array('success' => true));
exit;
} else {
echo json_encode(array('success' => false));
exit;
}
}
示例10: getOwnerByDasUid
/**
* Get list All owners of dashboards
*
* @access public
* @param array $options, Data for list
* @return array
*
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
* @copyright Colosa - Bolivia
*/
public function getOwnerByDasUid($options = array())
{
Validator::isArray($options, '$options');
G::LoadClass("dashboards");
$das_uid = isset( $options["das_uid"] ) ? $options["das_uid"] : "";
$start = isset( $options["start"] ) ? $options["start"] : "0";
$limit = isset( $options["limit"] ) ? $options["limit"] : "";
$search = isset( $options["search"] ) ? $options["search"] : "";
$paged = isset( $options["paged"] ) ? $options["paged"] : true;
$type = "extjs";
$start = (int)$start;
$start = abs($start);
if ($start != 0) {
$start--;
}
$limit = (int)$limit;
$limit = abs($limit);
if ($limit == 0) {
G::LoadClass("configuration");
$conf = new \Configurations();
$configList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
if (isset($configList['casesListRowNumber'])) {
$limit = (int)$configList['casesListRowNumber'];
} else {
$limit = 25;
}
} else {
$limit = (int)$limit;
}
$dashboards = new \Dashboards();
$result = $dashboards->getOwnerByDasUid($das_uid, $start, $limit, $search);
if ($paged == false) {
$response = $result['data'];
} else {
$response['totalCount'] = $result['totalCount'];
$response['start'] = $start+1;
$response['limit'] = $limit;
$response['search'] = $search;
$response['owner'] = $result['data'];
}
return $response;
}
示例11: array
if ($aFields['AUTH_SOURCE_PROVIDER'] != 'ldap') {
$G_PUBLISH->AddContent('propeltable', 'pagedTableLdap', 'authSources/ldapSearchResults', $oCriteria, ' ', array('Checkbox' => G::LoadTranslation('ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER')));
} else {
if (file_exists(PATH_XMLFORM . 'authSources/' . $aFields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
$G_PUBLISH->AddContent('propeltable', 'pagedTableLdap', 'authSources/' . $aFields['AUTH_SOURCE_PROVIDER'] . 'SearchResults', $oCriteria, ' ', array('Checkbox' => G::LoadTranslation('ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER')));
} else {
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => 'File: ' . $aFields['AUTH_SOURCE_PROVIDER'] . 'SearchResults.xml' . ' doesn\'t exist.'));
}
}
G::RenderPage('publish', 'raw');
break;
case 'authSourcesList':
require_once PATH_RBAC . 'model/AuthenticationSource.php';
global $RBAC;
G::LoadClass('configuration');
$co = new Configurations();
$config = $co->getConfiguration('authSourcesList', 'pageSize', '', $_SESSION['USER_LOGGED']);
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;
$filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : '';
$Criterias = $RBAC->getAuthenticationSources($start, $limit, $filter);
$Dat = AuthenticationSourcePeer::doSelectRS($Criterias['COUNTER']);
$Dat->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$Dat->next();
$row = $Dat->getRow();
$total_sources = $row['CNT'];
$oDataset = AuthenticationSourcePeer::doSelectRS($Criterias['LIST']);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
global $RBAC;
$auth = $RBAC->getAllUsersByAuthSource();
示例12: gotDirectoryStructureVer2
/**
* Extract the structure version value from serializated table field and check it.
* @return true if the version is bigger than 1
*/
public function gotDirectoryStructureVer2()
{
G::LoadClass("configuration");
$configuration = new Configurations();
if (defined('SYS_SYS') && $configuration->exists("ENVIRONMENT_SETTINGS")) {
return $configuration->getDirectoryStructureVer() > 1;
}
return false;
}
示例13: getList
//.........这里部分代码省略.........
$listpeer = 'ListUnassignedPeer';
break;
}
// Validate filters
$filters["start"] = (int)$filters["start"];
$filters["start"] = abs($filters["start"]);
if ($filters["start"] != 0) {
$filters["start"]+1;
}
$filters["limit"] = (int)$filters["limit"];
$filters["limit"] = abs($filters["limit"]);
if ($filters["limit"] == 0) {
G::LoadClass("configuration");
$conf = new \Configurations();
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
if (isset($generalConfCasesList['casesListRowNumber'])) {
$filters["limit"] = (int)$generalConfCasesList['casesListRowNumber'];
} else {
$filters["limit"] = 25;
}
} else {
$filters["limit"] = (int)$filters["limit"];
}
$filters["sort"] = G::toUpper($filters["sort"]);
$columnsList = $listpeer::getFieldNames(\BasePeer::TYPE_FIELDNAME);
if (!(in_array($filters["sort"], $columnsList))) {
$filters["sort"] = '';
}
示例14: getAllProcesses
public function getAllProcesses($start, $limit, $category = null, $processName = null, $counters = true, $reviewSubProcess = false, $userLogged = "")
{
require_once PATH_RBAC . "model/RbacUsers.php";
require_once "classes/model/ProcessCategory.php";
require_once "classes/model/Users.php";
$user = new RbacUsers();
$aProcesses = array();
$categories = array();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessPeer::PRO_UID);
$oCriteria->addSelectColumn(ProcessPeer::PRO_PARENT);
$oCriteria->addSelectColumn(ProcessPeer::PRO_STATUS);
$oCriteria->addSelectColumn(ProcessPeer::PRO_TYPE);
$oCriteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
$oCriteria->addSelectColumn(ProcessPeer::PRO_UPDATE_DATE);
$oCriteria->addSelectColumn(ProcessPeer::PRO_CREATE_DATE);
$oCriteria->addSelectColumn(ProcessPeer::PRO_CREATE_USER);
$oCriteria->addSelectColumn(ProcessPeer::PRO_DEBUG);
$oCriteria->addSelectColumn(ProcessPeer::PRO_TYPE_PROCESS);
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_UID);
$oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
$oCriteria->add(ProcessPeer::PRO_UID, '', Criteria::NOT_EQUAL);
$oCriteria->add(ProcessPeer::PRO_STATUS, 'DISABLED', Criteria::NOT_EQUAL);
if ($reviewSubProcess) {
$oCriteria->add(ProcessPeer::PRO_SUBPROCESS, '1', Criteria::NOT_EQUAL);
}
if (isset($category)) {
$oCriteria->add(ProcessPeer::PRO_CATEGORY, $category, Criteria::EQUAL);
}
$oCriteria->addJoin(ProcessPeer::PRO_CREATE_USER, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->addJoin(ProcessPeer::PRO_CATEGORY, ProcessCategoryPeer::CATEGORY_UID, Criteria::LEFT_JOIN);
if ($this->sort == "PRO_CREATE_DATE") {
if ($this->dir == "DESC") {
$oCriteria->addDescendingOrderByColumn(ProcessPeer::PRO_CREATE_DATE);
} else {
$oCriteria->addAscendingOrderByColumn(ProcessPeer::PRO_CREATE_DATE);
}
}
if ($userLogged != "") {
$oCriteria->add($oCriteria->getNewCriterion(ProcessPeer::PRO_TYPE_PROCESS, "PUBLIC", Criteria::EQUAL)->addOr($oCriteria->getNewCriterion(ProcessPeer::PRO_CREATE_USER, $userLogged, Criteria::EQUAL)));
}
$this->tmpCriteria = clone $oCriteria;
//execute a query to obtain numbers, how many cases there are by process
if ($counters) {
$casesCnt = $this->getCasesCountInAllProcesses();
}
// getting bpmn projects
$c = new Criteria('workflow');
$c->addSelectColumn(BpmnProjectPeer::PRJ_UID);
$ds = ProcessPeer::doSelectRS($c, Propel::getDbConnection('workflow_ro'));
$ds->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$bpmnProjects = array();
while ($ds->next()) {
$row = $ds->getRow();
$bpmnProjects[] = $row['PRJ_UID'];
}
//execute the query
$oDataset = ProcessPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$processes = array();
$uids = array();
while ($oDataset->next()) {
$row = $oDataset->getRow();
$row["PROJECT_TYPE"] = $row["PRO_TYPE"] == "NORMAL" ? in_array($row["PRO_UID"], $bpmnProjects) ? "bpmn" : "classic" : $row["PRO_TYPE"];
$processes[] = $row;
$uids[] = $processes[sizeof($processes) - 1]['PRO_UID'];
}
//process details will have the info about the processes
$processesDetails = array();
//now get the labels for all process, using an array of Uids,
$c = new Criteria('workflow');
//$c->add ( ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL );
$c->add(ContentPeer::CON_LANG, defined('SYS_LANG') ? SYS_LANG : 'en', Criteria::EQUAL);
$c->add(ContentPeer::CON_ID, $uids, Criteria::IN);
$dt = ContentPeer::doSelectRS($c, Propel::getDbConnection('workflow_ro'));
$dt->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($dt->next()) {
$row = $dt->getRow();
$processesDetails[$row['CON_ID']][$row['CON_CATEGORY']] = $row['CON_VALUE'];
}
G::loadClass('configuration');
$oConf = new Configurations();
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
foreach ($processes as $process) {
$proTitle = isset($processesDetails[$process['PRO_UID']]) && isset($processesDetails[$process['PRO_UID']]['PRO_TITLE']) ? $processesDetails[$process['PRO_UID']]['PRO_TITLE'] : '';
$proDescription = isset($processesDetails[$process['PRO_UID']]) && isset($processesDetails[$process['PRO_UID']]['PRO_DESCRIPTION']) ? $processesDetails[$process['PRO_UID']]['PRO_DESCRIPTION'] : '';
$process["PRO_TYPE_PROCESS"] = $process["PRO_TYPE_PROCESS"] == "PUBLIC" ? G::LoadTranslation("ID_PUBLIC") : G::LoadTranslation("ID_PRIVATE");
// verify if the title is already set on the current language
if (trim($proTitle) == '') {
// if not, then load the record to generate content for current language
$proData = $this->load($process['PRO_UID']);
$proTitle = $proData['PRO_TITLE'];
$proDescription = $proData['PRO_DESCRIPTION'];
}
//filtering by $processName
if (isset($processName) && $processName != '' && stripos($proTitle, $processName) === false) {
//.........这里部分代码省略.........
示例15: actionCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate()
{
$model = new Guardians();
$check_flag = 0;
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if ($_POST['student_id']) {
$guardian = Students::model()->findByAttributes(array('id' => $_POST['student_id']));
$gid = $guardian->parent_id;
} elseif ($_POST['guardian_id']) {
$gid = $_POST['guardian_id'];
} elseif ($_POST['guardian_mail']) {
$gid = $_POST['guardian_mail'];
}
if ($gid != NULL and $gid != 0) {
$model = Guardians::model()->findByAttributes(array('id' => $gid));
$this->render('create', array('model' => $model, 'radio_flag' => 1, 'guardian_id' => $gid));
} elseif ((isset($_POST['student_id']) or isset($_POST['guardian_id']) or isset($_POST['guardian_mail'])) and ($gid == NULL or $gid == 0)) {
Yii::app()->user->setFlash('errorMessage', UserModule::t("Guardian not found..!"));
}
if (isset($_POST['Guardians'])) {
$model->attributes = $_POST['Guardians'];
$model->validate();
if ($_POST['Guardians']['user_create'] == 1) {
$check_flag = 1;
}
//print_r($_POST['Guardians']); exit;
if ($model->save()) {
//echo $model->ward_id; exit;
$student = Students::model()->findByAttributes(array('id' => $model->ward_id));
$student->saveAttributes(array('parent_id' => $model->id));
if ($_POST['Guardians']['user_create'] == 0) {
//adding user for current guardian
$user = new User();
$profile = new Profile();
$user->username = substr(md5(uniqid(mt_rand(), true)), 0, 10);
$user->email = $model->email;
$user->activkey = UserModule::encrypting(microtime() . $model->first_name);
$password = substr(md5(uniqid(mt_rand(), true)), 0, 10);
$user->password = UserModule::encrypting($password);
$user->superuser = 0;
$user->status = 1;
if ($user->save()) {
//assign role
$authorizer = Yii::app()->getModule("rights")->getAuthorizer();
$authorizer->authManager->assign('parent', $user->id);
//profile
$profile->firstname = $model->first_name;
$profile->lastname = $model->last_name;
$profile->user_id = $user->id;
$profile->save();
//saving user id to guardian table.
$model->saveAttributes(array('uid' => $user->id));
//$model->uid = $user->id;
//$model->save();
// for sending sms
$sms_settings = SmsSettings::model()->findAll();
$to = '';
if ($sms_settings[0]->is_enabled == '1' and $sms_settings[2]->is_enabled == '1') {
// Checking if SMS is enabled.
if ($model->mobile_phone) {
$to = $model->mobile_phone;
}
if ($to != '') {
// Send SMS if phone number is provided
$college = Configurations::model()->findByPk(1);
$from = $college->config_value;
$message = 'Welcome to ' . $college->config_value;
SmsSettings::model()->sendSms($to, $from, $message);
}
// End send SMS
}
// End check if SMS is enabled
UserModule::sendMail($model->email, UserModule::t("You registered from {site_name}", array('{site_name}' => Yii::app()->name)), UserModule::t("Please login to your account with your email id as username and password {password}", array('{password}' => $password)));
}
}
$this->redirect(array('addguardian', 'id' => $model->ward_id));
}
}
$this->render('create', array('model' => $model, 'check_flag' => $check_flag));
}