Ejemplo n.º 1
0
 public function init()
 {
     parent::init();
     $this->setName('confirmRegisterForm');
     $this->setAttrib('id', 'confirm-register-form');
     $this->addElementPrefixPath('App_Validate', 'App/Validate/', 'validate');
     $this->setDecorators(array('FormElements', 'DijitForm'));
     $config = Initializer::getConfig();
     //--------------------------------------
     // Elements
     //--------------------------------------
     $this->addElement('ValidationTextBox', 'emailAddress', array('label' => 'Your E-Mail Address', 'description' => 'The E-mail address you wish you confirm', 'required' => true, 'trim' => true, 'filters' => array('StringToLower'), 'validators' => array(array('EmailAddress', false, array('validateMx' => true)))));
     $this->addElement('TextBox', 'code', array('label' => 'Confirmation Code', 'description' => 'This is the code you received from us.', 'required' => true, 'trim' => true, 'filters' => array('StringToUpper'), 'validators' => array('Alnum')));
     $this->addElement('SubmitButton', 'submit', array('ignore' => true, 'label' => 'Confirm My E-Mail Address'));
 }
Ejemplo n.º 2
0
 public function init()
 {
     parent::init();
     $config = Initializer::getConfig();
     $userId = Zend_Auth::getInstance()->getIdentity()->id;
     $this->setAttrib('id', 'new-track-form');
     $this->setDecorators(array('FormElements', 'DijitForm'));
     $this->addElement('FilteringSelect', 'releaseId', array('label' => 'Release', 'storeId' => 'artistReleasesDataStore', 'storeType' => 'dojo.data.ItemFileReadStore', 'description' => 'The release to attach this track to.  The track will still be downloadable as a single track, but will be grouped under the release', 'autocomplete' => true, 'storeParams' => array('url' => '/data/artists/releases/' . $userId . '?published=0', 'requestMethod' => 'get'), 'dijitParams' => array('searchAttr' => 'title')));
     $this->addElement('ValidationTextBox', 'title', array('label' => 'Track Title', 'required' => true, 'trim' => true, 'description' => 'The display title, appears in store', 'validators' => array(array('Alnum', false, array('allowWhiteSpace' => true)))));
     $this->addElement('DateTextBox', 'publishDate', array('label' => 'Publish Date', 'description' => 'The date which this track will be available for purchase', 'default' => date('m/d/Y')));
     $audioFile = new Zend_Form_Element_File('audioFile');
     $audioFile->setLabel('Master Audio File')->addDecorators(array('Description'))->setRequired(true)->setDescription('The original (master) track.  Must be a .WAV file')->setDestination($config->injestion->workDir)->addValidator('Extension', false, explode(',', $config->injestion->allowedExtensions))->addValidator('MimeType', false, explode(',', $config->injestion->allowedMimeTypes))->addFilter('Rename', array('target' => $config->injestion->workDir . '/track_' . str_pad($userId, 8, '0') . '_' . date('Ymdhs') . '.wav', 'overwrite' => true));
     $this->addElement($audioFile);
     $this->setEnctype('multipart/form-data');
     $this->addElement('SubmitButton', 'submit', array('ignore' => true, 'label' => 'Upload Track'));
 }
Ejemplo n.º 3
0
 public function init()
 {
     parent::init();
     $this->setName('registerForm');
     $this->setAttrib('id', 'register-form');
     $this->setMethod('post');
     $this->addElementPrefixPath('App_Validate', 'App/Validate/', 'validate');
     $this->setDecorators(array('FormElements', 'DijitForm'));
     $config = Initializer::getConfig();
     //--------------------------------------
     // Elements
     //--------------------------------------
     $this->addElement('ValidationTextBox', 'emailAddress', array('label' => 'Your E-Mail Address', 'description' => 'Give us your valid E-mail address.  We check this, so make sure its valid and you can access it.', 'required' => true, 'trim' => true, 'filters' => array('StringToLower'), 'validators' => array(array('EmailAddress', false, array('validateMx' => true)), array('UniqueAccountDetail', false, array('field' => 'emailAddress')))));
     $this->addElement('PasswordTextBox', 'password', array('label' => 'Choose a Password', 'description' => 'Make it a good one. It must be at least 6 characters', 'required' => true, 'trim' => false, 'validators' => array(array('StringLength', false, array(6)), array('PasswordConfirmation', true, array('field' => 'confirm_password')))));
     $this->addElement('PasswordTextBox', 'confirm_password', array('label' => 'Retype Your Password', 'description' => 'Just to make sure you didn\'t mess up', 'required' => true, 'trim' => false));
     $this->addElement('CheckBox', 'sellerAccount', array('label' => 'I want to sell music, too.', 'description' => 'Check this box if you want to sell music on BitNotion.  You will still be able to purchase music using this account.'));
     $this->addElement('Captcha', 'captcha', array('label' => 'Are you human?', 'descripton' => 'Type the letters shown, and prove you\'re smarter than the average robot.', 'captcha' => array('captcha' => 'ReCaptcha', 'privkey' => $config->recaptcha->privateKey, 'pubkey' => $config->recaptcha->publicKey)));
     $this->addElement('SubmitButton', 'submit', array('ignore' => true, 'label' => 'Create My Account'));
 }
Ejemplo n.º 4
0
#!/usr/bin/php
<?php 
require_once '../application/Initializer.php';
// must specify the environment as the first variable
if (!count($argv) > 1) {
    echo 'You must specify an environment as the first argument';
    exit(-1);
}
$init = new Initializer($argv[1]);
$config = $init->getConfig();
Zend_Loader::registerAutoload();
$s3 = new S3($config->aws->accessKey, $config->aws->secretKey);
$buckets = array($config->aws->publicBucket => S3::ACL_PUBLIC_READ, $config->aws->contentBucket => S3::ACL_PRIVATE);
$existingBuckets = $s3->listBuckets();
foreach ($buckets as $name => $acl) {
    if (!in_array($name, $existingBuckets)) {
        $s3->putBucket($name, $acl);
        echo "Bucket Added: {$name}\n";
    }
}