Esempio n. 1
0
   function MotpList()
   {
       $this->app->Tpl->Set(UEBERSCHRIFT, "mOTP Generator");
       $submit = $this->app->Secure->GetPOST("submit");
       if ($submit != "") {
           $pin = $this->app->Secure->GetPOST("pin");
           $secret = $this->app->Secure->GetPOST("secret");
           $this->app->Tpl->Set(MESSAGE, '<div class="ui-state-highlight ui-corner-all" style="padding: 0 .7em;"> 
 		<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span> 
 		<strong>Hinweis:</strong>Die neue PIN und das neue Secret wurden gespeichert!</p>
 		</div>');
           $tmp = new INI();
           $arr = $tmp->read("/opt/fred/apps/motp/motp.ini");
           $arr[motp][secret] = $secret;
           $arr[motp][pin] = $pin;
           $tmp->write("/opt/fred/apps/motp/motp.ini", $arr);
           //        exec("echo '$pin' > /root/otppin");
           //        exec("echo '$secret' > /root/otpsecret");
       }
       $tmp = new INI();
       $arr = $tmp->read("/opt/fred/apps/motp/motp.ini");
       //$pin = shell_exec("cat /root/otppin");
       $this->app->Tpl->Set(PIN, $arr[motp][pin]);
       //$secret = shell_exec("cat /root/otpsecret");
       $this->app->Tpl->Set(SECRET, $arr[motp][secret]);
       date_default_timezone_set('UTC');
       $uhrzeit = date('d.m.Y H:i:s');
       $this->app->Tpl->Set(UHRZEIT, $uhrzeit);
       $this->app->Tpl->Parse(UEBERSCHRIFT, "mOTP");
       $this->app->Tpl->Parse(PAGE, "motp.tpl");
   }
Esempio n. 2
0
                 $key = 'language_' . $code;
                 $ini2[$key] = array();
                 foreach ($ini2['language'] as $lngfile) {
                     if (file_exists($lngdir . $lngfile)) {
                         $ini2[$key][] = $lngfile;
                     }
                 }
             } else {
                 $key = 'language';
             }
             $dirs[] = array('orig' => $lngdir, 'new' => str_replace('_', '/', $key) . '/');
         }
     }
 }
 if ($has_plugins == true) {
     $myini->write($pini, $ini);
 }
 if ($has_component == true) {
     $myini->write($cini, $ini2);
 }
 // Determine standard template pack
 $loaddesign_obj = $scache->load('loaddesign');
 $cache = $loaddesign_obj->get();
 $design = $cache[$config['templatedir']];
 // ZIP-File
 $tempdir = "temp/";
 $file = $data['internal'] . '.zip';
 require_once 'classes/class.zip.php';
 $error = array();
 $archive = new PclZip($tempdir . $file);
 // Add modules directory
Esempio n. 3
0
    echo head();
    $name = $gpc->get('name', str);
    $id = $gpc->get('id', int);
    $package = $gpc->get('package', int);
    $db->query("DELETE FROM {$db->pre}settings WHERE name = '{$name}' AND sgroup = '{$id}' LIMIT 1");
    $upd = $db->affected_rows();
    if ($upd == 1) {
        $result = $db->query("SELECT name FROM {$db->pre}settings_groups WHERE id = '{$id}'");
        $row = $db->fetch_assoc($result);
        $c->getdata();
        $c->delete(array($row['name'], $name));
        $c->savedata();
        if ($package > 0) {
            $ini = $myini->read("modules/{$package}/package.ini");
            unset($ini['setting_' . $name]);
            $myini->write("modules/{$package}/package.ini", $ini);
        }
        ok('admin.php?action=settings&job=custom&id=' . $id . '&package=' . $package, $lang->phrase('admin_setting_deleted'));
    } else {
        error('admin.php?action=settings&job=custom&id=' . $id . '&package=' . $package, $lang->phrase('admin_setting_not_available'));
    }
} elseif ($job == 'delete_group') {
    echo head();
    $id = $gpc->get('id', int);
    $package = $gpc->get('package', int);
    $result = $db->query("\n\tSELECT s.name, g.name AS groupname\n\tFROM {$db->pre}settings AS s\n\t\tLEFT JOIN {$db->pre}settings_groups AS g ON s.sgroup = g.id\n\tWHERE s.sgroup = '{$id}'");
    if ($package > 0) {
        $ini = $myini->read("modules/{$package}/package.ini");
    }
    while ($row = $db->fetch_assoc($result)) {
        $c->getdata();
Esempio n. 4
0
 }
 $file = 'smileys_' . gmdate('Ymd', times()) . '.zip';
 $tempdir = "temp/";
 $smilieconfig = $config['smileypath'] . '/smileys.ini';
 $result = $db->query('SELECT `id`, `search`, `replace`, `desc` FROM `' . $db->pre . 'smileys` ' . $sqlwhere);
 $files = array();
 $filedata = array();
 while ($row = $db->fetch_assoc($result)) {
     $filepath = str_replace('{folder}', $config['smileypath'], $row['replace']);
     $filedata[$row['id']] = array('search' => $row['search'], 'replace' => $row['replace'], 'desc' => $row['desc']);
     if (!preg_match('~http(s)?:\\/\\/~i', $filepath)) {
         $files[] = $filepath;
     }
 }
 $myini = new INI();
 $myini->write($smilieconfig, $filedata);
 $files[] = $smilieconfig;
 $files = array_unique($files);
 require_once 'classes/class.zip.php';
 $archive = new PclZip($tempdir . $file);
 // Have to parse $dir with PclZipUtilTranslateWinPath to have equal paths at $files-Array and $dir (PclZip-Bug?)
 $v_list = $archive->create($files, PCLZIP_OPT_REMOVE_PATH, PclZipUtilTranslateWinPath($config['smileypath']));
 if ($v_list == 0) {
     echo head();
     unset($archive);
     $filesystem->unlink($smilieconfig);
     error('admin.php?action=bbcodes&job=smileys', $archive->errorInfo(true));
 } else {
     viscacha_header('Content-Type: application/zip');
     viscacha_header('Content-Disposition: attachment; filename="' . $file . '"');
     viscacha_header('Content-Length: ' . filesize($tempdir . $file));
Esempio n. 5
0
 $file = convert2adress($info['name']) . '.zip';
 $dirs = array();
 if ($tpl == 1) {
     $dirs[] = array('dir' => "templates/{$info['template']}/", 'func' => 'export_template_list');
 }
 if ($img == 1) {
     $dirs[] = array('dir' => "images/{$info['images']}/", 'func' => '');
 }
 if ($css == 1) {
     $dirs[] = array('dir' => "designs/{$info['stylesheet']}/", 'func' => '');
 }
 $tempdir = "temp/";
 $error = false;
 $settings = $tempdir . 'design.ini';
 $myini = new INI();
 $myini->write($settings, $info);
 require_once 'classes/class.zip.php';
 $archive = new PclZip($tempdir . $file);
 $v_list = $archive->create($settings, PCLZIP_OPT_REMOVE_PATH, $tempdir);
 if ($v_list == 0) {
     $error = true;
 } else {
     foreach ($dirs as $dir) {
         $archive = new PclZip($tempdir . $file);
         if (!empty($dir['func']) && viscacha_function_exists($dir['func'])) {
             $list = $dir['func']($dir['dir']);
             $v_list = $archive->add($list, PCLZIP_OPT_REMOVE_PATH, $dir['dir'], PCLZIP_OPT_ADD_PATH, extract_dir($dir['dir'], false));
         } else {
             $v_list = $archive->add($dir['dir'], PCLZIP_OPT_REMOVE_PATH, $dir['dir'], PCLZIP_OPT_ADD_PATH, extract_dir($dir['dir'], false));
         }
         if ($v_list == 0) {
Esempio n. 6
0
            $data = array('title' => $file, 'internal' => "viscacha_" . substr($file, 0, strlen($file) - 4), 'version' => "", 'copyright' => "Copyright (c) 2007 by Matthias Mohr, MaMo Net (http://www.mamo-net.de)", 'summary' => "", 'license' => "GNU General Public License", 'min_version' => "", 'max_version' => "", 'url' => "http://www.viscacha.org", 'file' => "http://files.viscacha.org/{$dir}/" . rawurlencode($ini['categories'][$dirid]) . "/{$file}", 'preview' => "", 'category' => $dirid, 'multiple' => 0, 'last_updated' => filemtime($fp));
            if ($key == IMPTYPE_PACKAGE) {
                $zip = new PclZip($fp);
                $list = $zip->extract(PCLZIP_OPT_BY_NAME, "modules/package.ini", PCLZIP_OPT_EXTRACT_AS_STRING);
                $package = $myini->parse($list[0]['content']);
                if (empty($package['info']['title']) || empty($package['info']['internal'])) {
                    continue;
                }
                $data = array_merge($data, $package['info']);
                unset($data['core']);
            }
            $md5 = md5_file($fp);
            $ini[$md5] = $data;
        }
    }
    $myini->write('viscacha/files/external_' . $key . '.ini', $ini);
    ?>
		<hr />
		Files generated: <a href="viscacha/files/external_<?php 
    echo $key;
    ?>
.ini">external_<?php 
    echo $key;
    ?>
.ini</a>
		<pre><?php 
    print_r($ini);
    ?>
</pre>
	<?php 
}
<?php

if (defined('VISCACHA_CORE') == false) {
    die('Error: Hacking Attempt');
}
global $db, $config;
$result = $db->query("SELECT COUNT(*) FROM {$db->pre}topics");
list($topics) = $db->fetch_num($result);
$result = $db->query("SELECT COUNT(*) FROM {$db->pre}replies");
list($posts) = $db->fetch_num($result);
$result = $db->query("SELECT COUNT(*) FROM {$db->pre}user WHERE confirm = '11'");
list($members) = $db->fetch_num($result);
include "language/{$config['langdir']}/settings.lng.php";
$lngc = $lang['lang_code'];
if (!empty($lang['country_code'])) {
    $lngc .= '_' . $lang['country_code'];
}
$data = array('settings' => array('url' => $config['furl'], 'name' => $config['fname'], 'description' => $config['fdesc'], 'version' => $config['version'], 'language' => $lngc), 'statistics' => array('topics' => intval($topics), 'posts' => intval($posts), 'members' => intval($members)));
$myini = new INI();
$myini->write('feeds/board_data.ini', $data);
Esempio n. 8
0
<?php

require_once 'php/ini.php';
$ini = INI::read('config.ini');
$stat = 0;
if (@$_POST && $_POST['isIni']) {
    foreach ($_POST as $key => $value) {
        $pos = strpos($key, '|');
        $key1 = substr($key, 0, $pos);
        $key2 = substr($key, $pos + 1);
        if (strlen($key1)) {
            $ini[$key1][$key2] = $value;
        }
    }
    is_writeable('config.ini') ? $stat = 1 : ($stat = -1);
    INI::write('config.ini', $ini);
}
echo "<form method='post' id='frm_settings'>\n";
echo "<input type=\"hidden\" name=\"isIni\" value=\"1\">";
echo "<table>\n";
foreach ($ini as $key => $value) {
    echo "<tr align=\"left\">\n";
    echo "<td colspan=\"2\"><span id=\"{$key}\"><b>{$key}</b><span></td>\n";
    echo "</tr>\n";
    foreach ($value as $subkey => $subvalue) {
        echo "<tr align=\"left\">\n";
        $ln = strlen($subvalue) + 5;
        echo "<td>{$subkey}:</td><td><input name=\"{$key}|{$subkey}\" id=\"{$key}|{$subkey}\" value=\"{$subvalue}\" size=\"" . ($ln < 60 ? $ln : 60) . "\"><br></td>\n";
        echo "</tr>\n";
    }
}