<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/

class Userprofilelock_AdminSettingsController extends Core_Controller_Action_Admin {

  public function indexAction() {

    $db = Engine_Db_Table::getDefaultAdapter();
    
    $this->view->form = $form = new Userprofilelock_Form_Admin_Settings_Global();

		if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {
      $values = $form->getValues();

			include_once APPLICATION_PATH . "/application/modules/Userprofilelock/controllers/License.php";
      if (Engine_Api::_()->getApi('settings', 'core')->getSetting('userprofilelock.pluginactivated')) {
				foreach ($values as $key => $value) {
					Engine_Api::_()->getApi('settings', 'core')->setSetting($key, $value);
				}
				$form->addNotice('Your changes have been saved.');
				if($error)
					$this->_helper->redirector->gotoRoute(array());
			}
  	}
  }
}
