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

class User_Form_Admin_Otp_Amazon extends Engine_Form {

  public function init() {
  
    parent::init();

    $this->setTitle('Integration with Amazon')
        ->setDescription('Fill up the form below to integrate amazon services to enable OTP on your site.');

    $this->addElement('Text','clientId',array(
      'label'=>'Client Id',
      'description'=> 'Enter the Client ID below.',
      'required'=>true,
      'allowEmpty'=>false,
    ));
    
    $this->addElement('Text','clientSecret',array(
      'label'=>'Client Secret',
      'description'=> 'Enter the Client Secret below.',
      'required'=>true,
      'allowEmpty'=>false,
    ));
    
    // Element: region
    $this->addElement('Select', 'region', array(
      'label' => 'Region',
      'required' => true,
      'allowEmpty' => false,
      'multiOptions' => array(
        'us-east-1' => 'US East (N. Virginia)',
        'us-east-2' => 'US East (Ohio)',
        'us-west-1' => 'US West (Northern California)',
        'us-west-2' => 'US West (Oregon)',
        'ap-south-1' => 'Asia Pacific (Mumbai)',
        'ap-northeast-3' => 'Asia Pacific (Osaka)',
        'ap-northeast-2' => 'Asia Pacific (Seoul)',
        'ap-southeast-1' => 'Asia Pacific (Singapore)',
        'ap-southeast-2' => 'Asia Pacific (Sydney)',
        'ap-northeast-1' => 'Asia Pacific (Tokyo)',
        'ca-central-1' => 'Canada (Central)',
        'eu-central-1' => 'Europe (Frankfurt)',
        'eu-west-1' => 'Europe (Ireland)',
        'eu-west-2' => 'Europe (London)',
        'eu-west-3' => 'Europe (Paris)',
        'eu-north-1' => 'Europe (Stockholm)',
        'sa-east-1' => 'South America (Sao Paulo)',
      ),
    ));
    
    $this->addElement('Select','enabled',array(
      'label'=>'Enable',
      'description'=> 'Do you want to enable Amazon Services?',
      'multiOptions'=>array('1'=>'Yes','0'=>'No'),
      'required'=>true,
      'allowEmpty'=>false,
      'value' => Engine_Api::_()->getApi('settings', 'core')->getSetting('otpsms.integration') ? 1 : 0,
    ));
    
    $this->addElement('Button','submit',array(
      'label'=>'Save Changes',
      'type'=>'submit',
      'ignore'=>true
    ));
  }
}
