Пример #1
0
 /**
  * Remove cookie.jar if configs change and convert form password to password element
  * @param string $section
  * @param string $namespace
  * @param unknown_type $key
  * @param Zend_Form_Element $element
  * @param Zend_Form $form
  * @param Zend_Controller_Action $controller
  */
 public function prepareConfigElement($section, $namespace, $key, Zend_Form_Element $element, Zend_Form $form, Zend_Controller_Action $controller)
 {
     // nothing to do if this isn't the right section
     if ($namespace != $this->getId()) {
         return;
     }
     switch ($key) {
         // i have to convert it to a password element
         case 'plugins_weebtv_auth_password':
             $password = $form->createElement('password', 'plugins_weebtv_auth_password', array('label' => $element->getLabel(), 'description' => $element->getDescription(), 'renderPassword' => true));
             $form->plugins_weebtv_auth_password = $password;
             break;
     }
 }
 /**
  *
  * @param Zend_Form_Element $element
  * @return string 
  */
 protected function getDescriptionHTML($element)
 {
     $desc = $element->getDescription();
     if (empty($desc)) {
         return '';
     }
     return '<div class="description">' . $desc . '</div>';
 }
Пример #3
0
 /**
  * Remove cookie.jar if configs change and convert form password to password element
  * @param string $section
  * @param string $namespace
  * @param unknown_type $key
  * @param Zend_Form_Element $element
  * @param Zend_Form $form
  * @param Zend_Controller_Action $controller
  */
 public function prepareConfigElement($section, $namespace, $key, Zend_Form_Element $element, Zend_Form $form, Zend_Controller_Action $controller)
 {
     // nothing to do if this isn't the right section
     if ($namespace != $this->getId()) {
         return;
     }
     switch ($key) {
         // i have to convert it to a password element
         case 'plugins_megavideo_premium_password':
             $password = $form->createElement('password', 'plugins_megavideo_premium_password', array('label' => $element->getLabel(), 'description' => $element->getDescription(), 'renderPassword' => true));
             $form->plugins_megavideo_premium_password = $password;
             break;
     }
     // remove cookie.jar if somethings has value
     if (!$form->isErrors() && !is_null($element->getValue()) && file_exists(APPLICATION_PATH . '/../data/megavideo/cookie.jar')) {
         if (@(!unlink(APPLICATION_PATH . '/../data/megavideo/cookie.jar'))) {
             X_Debug::e("Error removing cookie.jar");
         }
     }
 }
Пример #4
0
 /**
  * Convert form password to password element
  * @param string $section
  * @param string $namespace
  * @param unknown_type $key
  * @param Zend_Form_Element $element
  * @param Zend_Form $form
  * @param Zend_Controller_Action $controller
  */
 public function prepareConfigElement($section, $namespace, $key, Zend_Form_Element $element, Zend_Form $form, Zend_Controller_Action $controller)
 {
     // nothing to do if this isn't the right section
     if ($namespace != $this->getId()) {
         return;
     }
     switch ($key) {
         // i have to convert it to a password element
         case 'plugins_rapidshare_premium_password':
             $password = $form->createElement('password', 'plugins_rapidshare_premium_password', array('label' => $element->getLabel(), 'description' => $element->getDescription(), 'renderPassword' => true));
             $form->plugins_rapidshare_premium_password = $password;
             break;
     }
     // remove cookie if somethings has value
     if (!$form->isErrors() && !is_null($element->getValue()) && ($key = 'plugins_rapidshare_premium_password')) {
         // clean cookies
         try {
             X_Debug::i("Cleaning up cookies in cache");
             /* @var $cacheHelper X_VlcShares_Plugins_Helper_Cache */
             $cacheHelper = X_VlcShares_Plugins::helpers()->helper('cache');
             try {
                 $cacheHelper->retrieveItem("rapidshare::cookie");
                 // set expire date to now!
                 $cacheHelper->storeItem("rapidshare::cookie", '', 0);
             } catch (Exception $e) {
                 // nothing to do
             }
             try {
                 $cacheHelper->retrieveItem("rapidshare::lastreloginflag");
                 // set expire date to now!
                 $cacheHelper->storeItem("realdebrid::lastreloginflag", '', 0);
             } catch (Exception $e) {
                 // nothing to do
             }
         } catch (Exception $e) {
             X_Debug::w("Cache plugin disabled? O_o");
         }
     }
 }