Example #1
0
<?php

/* check if we need this

$output=Array();                                                                                                                            

$return=1;                                                                                                                                  

exec('which latex',$output,$return);

*/
// only load text editor if the user is logged in
if (\OCP\User::isLoggedIn()) {
    OCP\Util::callRegister();
    $eventDispatcher = \OC::$server->getEventDispatcher();
    $eventDispatcher->addListener('OCA\\Files::loadAdditionalScripts', function () {
        OCP\Util::addscript('files_latexeditor', 'livequery');
        OCP\Util::addscript('files_latexeditor', 'latexeditor');
    });
}
Example #2
0
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
*
*/
OCP\User::checkAdminUser();
$params = array('av_mode' => 'executable', 'av_socket' => '/var/run/clamav/clamd.ctl', 'av_host' => '', 'av_port' => '', 'av_cmd_options' => '', 'av_chunk_size' => '1024', 'av_path' => '/usr/bin/clamscan', 'infected_action' => 'only_log');
if ($_POST) {
    OCP\Util::callCheck();
    foreach ($params as $param => $default) {
        if (isset($_POST[$param])) {
            OCP\Config::setAppValue('files_antivirus', $param, $_POST[$param]);
        }
    }
}
// fill template
$tmpl = new OCP\Template('files_antivirus', 'settings');
$tmpl->assign('requesttoken', OCP\Util::callRegister());
OCP\Util::addStyle('files_antivirus', 'settings');
OCP\Util::addScript('files_antivirus', 'settings');
foreach ($params as $param => $default) {
    $value = OCP\Config::getAppValue('files_antivirus', $param, $default);
    $tmpl->assign($param, $value);
}
return $tmpl->fetchPage();
Example #3
0
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the license, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library.
* If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
 * @file core/ajax/requesttoken.php
 * @brief Ajax method to retrieve a fresh request protection token for ajax calls
 * @return json: success/error state indicator including a fresh request token
 * @author Christian Reiner
 */
require_once '../../lib/base.php';
// don't load apps or filesystem for this task
$RUNTIME_NOAPPS = TRUE;
$RUNTIME_NOSETUPFS = TRUE;
// Sanity checks
// using OCP\JSON::callCheck() below protects the token refreshing itself.
//OCP\JSON::callCheck ( );
OCP\JSON::checkLoggedIn();
// hand out a fresh token
OCP\JSON::success(array('token' => OCP\Util::callRegister()));
 * @file ajax/requesttoken.php
 * @brief Ajax method to retrieve a fresh request token for ajax calls
 * @return json: success/error state indicator
 * @return json: Associative array of counts
 * @author Christian Reiner
 */

// swallow any accidential output generated by php notices and stuff to preserve a clean JSON reply structure
OC_Shorty_Tools::ob_control ( TRUE );

// don't load apps or filesystem for this task
$RUNTIME_NOAPPS    = TRUE;
$RUNTIME_NOSETUPFS = TRUE;

// Sanity checks
// using OCP\JSON::callCheck() below protects the token refreshing itself.
//OCP\JSON::callCheck ( );
OCP\JSON::checkLoggedIn ( );
OCP\JSON::checkAppEnabled ( 'shorty' );

try
{
	// generate a fresh token
	$token = OCP\Util::callRegister ( );

	// swallow any accidential output generated by php notices and stuff to preserve a clean JSON reply structure
	OC_Shorty_Tools::ob_control ( FALSE );
	OCP\JSON::success ( array ( 'token'   => $token ) );
} catch ( Exception $e ) { OC_Shorty_Exception::JSONerror($e); }
?>