Esempio n. 1
0
 public function __construct()
 {
     if (defined('ENABLE_MARKETPLACE_SUPPORT') && ENABLE_MARKETPLACE_SUPPORT == false) {
         $this->connectionError = Marketplace::E_MARKETPLACE_SUPPORT_MANUALLY_DISABLED;
         return;
     }
     $csToken = Config::get('MARKETPLACE_SITE_TOKEN');
     if ($csToken != '') {
         $fh = Loader::helper('file');
         $csiURL = urlencode(BASE_URL . DIR_REL);
         $url = MARKETPLACE_URL_CONNECT_VALIDATE . "?csToken={$csToken}&csiURL=" . $csiURL . "&csiVersion=" . APP_VERSION;
         $vn = Loader::helper('validation/numbers');
         $r = $fh->getContents($url);
         if ($r == false) {
             $this->isConnected = true;
         } else {
             if ($vn->integer($r)) {
                 $this->isConnected = false;
                 $this->connectionError = $r;
                 if ($this->connectionError == Marketplace::E_DELETED_SITE_TOKEN) {
                     Config::clear('MARKETPLACE_SITE_TOKEN');
                     Config::clear('MARKETPLACE_SITE_URL_TOKEN');
                 }
             } else {
                 $this->isConnected = false;
                 $this->connectionError = self::E_GENERAL_CONNECTION_ERROR;
             }
         }
     }
 }
Esempio n. 2
0
 /**
  * @param array $options
  * @param bool $override
  * @return $this
  */
 public function setOptions(array $options, $override = false)
 {
     if ($override) {
         $this->options->clear();
     }
     $this->options->loadArray($options);
     return $this;
 }
 /**
  * Works on destroying table data
  */
 public function uninstall()
 {
     die('serious?');
     // clears all tables !!!
     \Model\User::setdown();
     \Model\Payload::setdown();
     \Model\Webot::setdown();
     $cfg = new Config();
     $cfg->clear('ACTIVE_DB');
     $cfg->save();
     \Base::instance()->clear('SESSION');
     echo "Done Uninstalling Current Tables!";
 }
Esempio n. 4
0
 public function uninstall()
 {
     die('serious?');
     // clears all tables !!!
     \Model\Post::setdown();
     \Model\Tag::setdown();
     \Model\Comment::setdown();
     \Model\User::setdown();
     $cfg = new Config();
     $cfg->clear('ACTIVE_DB');
     $cfg->save();
     \Base::instance()->clear('SESSION');
     echo "goodbye!";
 }
Esempio n. 5
0
 /**
  * Writes the core pointer into config/update.php.
  * 
  * @return true|int Returns true if the configuration file was updated, otherwise it returns the error code (one of the ApplicationUpdate::E_... constants)
  */
 public function apply()
 {
     $updates = array();
     $update_file = DIR_CONFIG_SITE . '/update.php';
     if (file_exists($update_file)) {
         if (!is_writable($update_file)) {
             return self::E_UPDATE_WRITE_CONFIG;
         }
         $updates = (array) (include $update_file);
     }
     $updates['core'] = $this->getUpdateIdentifier();
     \Config::clear('concrete.version');
     $renderer = new Renderer($updates);
     file_put_contents($update_file, $renderer->render());
     return true;
 }
Esempio n. 6
0
	public function save_settings() {
		Config::save('MAIL_SEND_METHOD', $this->post('MAIL_SEND_METHOD'));
		if ($this->post('MAIL_SEND_METHOD')== 'SMTP') {
			Config::save('MAIL_SEND_METHOD_SMTP_SERVER', $this->post('MAIL_SEND_METHOD_SMTP_SERVER'));
			Config::save('MAIL_SEND_METHOD_SMTP_USERNAME', $this->post('MAIL_SEND_METHOD_SMTP_USERNAME'));
			Config::save('MAIL_SEND_METHOD_SMTP_PASSWORD', $this->post('MAIL_SEND_METHOD_SMTP_PASSWORD'));
			Config::save('MAIL_SEND_METHOD_SMTP_PORT', $this->post('MAIL_SEND_METHOD_SMTP_PORT'));
			Config::save('MAIL_SEND_METHOD_SMTP_ENCRYPTION', $this->post('MAIL_SEND_METHOD_SMTP_ENCRYPTION'));
		} else {
			Config::clear('MAIL_SEND_METHOD_SMTP_SERVER');
			Config::clear('MAIL_SEND_METHOD_SMTP_USERNAME');
			Config::clear('MAIL_SEND_METHOD_SMTP_PASSWORD');
			Config::clear('MAIL_SEND_METHOD_SMTP_PORT');
			Config::clear('MAIL_SEND_METHOD_SMTP_ENCRYPTION');
		}
		$this->redirect("/dashboard/settings/mail", "settings_updated");
	}
Esempio n. 7
0
 public function save_settings()
 {
     if (!Loader::helper('validation/token')->validate('save_settings')) {
         $this->error->add(t('Invalid Token.'));
         return;
     }
     Config::save('MAIL_SEND_METHOD', $this->post('MAIL_SEND_METHOD'));
     if ($this->post('MAIL_SEND_METHOD') == 'SMTP') {
         Config::save('MAIL_SEND_METHOD_SMTP_SERVER', $this->post('MAIL_SEND_METHOD_SMTP_SERVER'));
         Config::save('MAIL_SEND_METHOD_SMTP_USERNAME', $this->post('MAIL_SEND_METHOD_SMTP_USERNAME'));
         Config::save('MAIL_SEND_METHOD_SMTP_PASSWORD', $this->post('MAIL_SEND_METHOD_SMTP_PASSWORD'));
         Config::save('MAIL_SEND_METHOD_SMTP_PORT', $this->post('MAIL_SEND_METHOD_SMTP_PORT'));
         Config::save('MAIL_SEND_METHOD_SMTP_ENCRYPTION', $this->post('MAIL_SEND_METHOD_SMTP_ENCRYPTION'));
     } else {
         Config::clear('MAIL_SEND_METHOD_SMTP_SERVER');
         Config::clear('MAIL_SEND_METHOD_SMTP_USERNAME');
         Config::clear('MAIL_SEND_METHOD_SMTP_PASSWORD');
         Config::clear('MAIL_SEND_METHOD_SMTP_PORT');
         Config::clear('MAIL_SEND_METHOD_SMTP_ENCRYPTION');
     }
     $this->redirect("/dashboard/system/mail/method", "settings_updated");
 }
Esempio n. 8
0
 public function testAddingBadgeToUser()
 {
     \Cache::disableAll();
     \Config::set('concrete.email.enabled', false);
     \Config::set('concrete.log.emails', false);
     Action::add('won_badge', t('Won a Badge'), 5, false);
     $g = Group::add('Test Group', 'Gettin a Badge');
     $g->setBadgeOptions(0, 'test', 10);
     $g = Group::getByID(1);
     $user = \Concrete\Core\User\UserInfo::add(array('uName' => 'testuser', 'uEmail' => '*****@*****.**'));
     $uo = $user->getUserObject();
     $uo->enterGroup($g);
     \Config::clear('concrete.email.enabled');
     \Config::clear('concrete.log.emails');
     $list = new EntryList();
     $list->filterbyUserName('testuser');
     $results = $list->get();
     $this->assertEquals(1, count($results));
     $result = $results[0];
     $this->assertInstanceOf('\\Concrete\\Core\\User\\Point\\Entry', $result);
     /* @var $result \Concrete\Core\User\Point\Entry */
     $this->assertInstanceOf('\\Concrete\\Core\\User\\Point\\Action\\WonBadgeAction', $result->getUserPointEntryActionObject());
     $this->assertInstanceOf('\\Concrete\\Core\\User\\Point\\Action\\WonBadgeActionDescription', $result->getUserPointEntryDescriptionObject());
 }
Esempio n. 9
0
 public function clearConfig($cfKey)
 {
     $co = new Config();
     $co->setPackageObject($this);
     return $co->clear($cfKey);
 }
 public function clearOverrideCache()
 {
     Config::clear("ENVIRONMENT_CACHE");
     $this->overridesScanned = false;
 }
 public function check_for_updates()
 {
     Config::clear('APP_VERSION_LATEST', false);
     Update::getLatestAvailableVersionNumber();
     $this->redirect('/dashboard/system/backup_restore/update');
 }
Esempio n. 12
0
 public function testClearWithPackage()
 {
     $store = $this->getStoreMock();
     $store->expects($this->once())->method('delete')->with($this->equalTo('test'), $this->equalTo(112));
     Config::setStore($store);
     $packagemock = $this->getMock('stdClass', array('getPackageID'));
     $packagemock->expects($this->once())->method('getPackageID')->will($this->returnValue(112));
     $config = new Config();
     $config->setPackageObject($packagemock);
     $config->clear('test', 112);
 }
Esempio n. 13
0
 public function testPublicProfileLink()
 {
     \Config::set('concrete.user.profiles_enabled', false);
     $service = Core::make('user.registration');
     $ui = $service->create(array('uName' => 'andrew', 'uEmail' => '*****@*****.**'));
     $this->assertEquals(null, $ui->getUserPublicProfileUrl());
     \Config::set('concrete.user.profiles_enabled', true);
     $this->assertInstanceOf('Concrete\\Core\\Url\\UrlInterface', $ui->getUserPublicProfileUrl());
     $url = (string) $ui->getUserPublicProfileUrl();
     $this->assertEquals('http://www.dummyco.com/path/to/server/index.php/members/profile/view/1', $url);
     \Config::clear('concrete.user.profiles_enabled');
 }
Esempio n. 14
0
File: core.php Progetto: pihizi/qf
 static function reload_config()
 {
     Config::clear();
     foreach (array_reverse(Core::$PATHS) as $p => $n) {
         Config::load($p);
     }
 }
Esempio n. 15
0
        ?>
</p>
							<select name="importer" class="pct50">
								<?php 
        foreach ($import_names as $name) {
            echo "<option>{$name}</option>";
        }
        ?>
							</select>
							<p class="submit"><input type="submit" class="button" name="import" value="<?php 
        _e('Select');
        ?>
"></p>
						<?php 
    }
} else {
    echo Plugins::filter('import_stage', '', @$_POST['importer'], @$_POST['stage'], @$_POST['step']);
}
if (isset($_POST['importer'])) {
    echo '<input type="hidden" name="importer" value="' . $_POST['importer'] . '">';
}
?>
		</form>

	
</div>

<?php 
// unset db_connection, since we don't need it any more
Config::clear('db_connection');
include 'footer.php';
Esempio n. 16
0
 public function reset()
 {
     Config::clear("SEO_EXCLUDE_WORDS");
     $this->redirect('/dashboard/system/seo/excluded', 'reset_complete');
 }