Ejemplo n.º 1
0
 /**
  * Checks, if Citruscart already generated a secret word. If not, it generates one
  * 
  * @version 0.8.3
  * @return boolean
  */
 function checkSecretWord()
 {
     //if this has already been done, don't repeat
     if (Citruscart::getInstance()->get('checkSecretWord', '0')) {
         return true;
     }
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_citruscart/tables');
     $config = JTable::getInstance('Config', 'CitruscartTable');
     $config->config_name = 'secret_word';
     Citruscart::load('CitruscartHelperBase', 'helper._base');
     $config->value = CitruscartHelperBase::generateSecretWord();
     if ($config->save()) {
         unset($config->config_id);
         // Update config to say this has been done already
         $config->load(array('config_name' => 'checkSecretWord'));
         $config->config_name = 'checkSecretWord';
         $config->value = '1';
         $config->save();
         return true;
     }
     return false;
 }