NotDemoValidate.php 536 B

12345678910111213141516171819202122232425
  1. <?php
  2. class Application_Validate_NotDemoValidate extends Zend_Validate_Abstract
  3. {
  4. const NOTDEMO = 'notdemo';
  5. protected $_messageTemplates = array(
  6. self::NOTDEMO => "Cannot be changed in demo mode"
  7. );
  8. public function isValid($value)
  9. {
  10. $this->_setValue($value);
  11. $CC_CONFIG = Config::getConfig();
  12. if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) {
  13. $this->_error(self::NOTDEMO);
  14. return false;
  15. } else {
  16. return true;
  17. }
  18. }
  19. }