function nav()
{
    unset($_SESSION['index_class']);
    unset($_SESSION['editmix_class']);
    unset($_SESSION['validate_class']);
    unset($_SESSION['makemix_class']);
    unset($_SESSION['mwbedocs_class']);
    unset($_SESSION['upfiles_class']);
    if ($_SESSION['action'] == "index") {
        index();
    } elseif ($_SESSION['action'] == "makemix") {
        makemix();
    } elseif ($_SESSION['action'] == "upfiles") {
        upfiles();
    } elseif ($_SESSION['action'] == "verify") {
        verify();
    } elseif ($_SESSION['action'] == "validate") {
        validate();
    } elseif ($_SESSION['action'] == "editmix") {
        editmix();
    } elseif ($_SESSION['action'] == "mwbedocs") {
        mwbedocs();
    } elseif ($_SESSION['action'] == "delmix") {
        delmix();
    } else {
        index();
    }
}
 public function checkEntityFieldIntegrity($entityName, $entityFieldName, $testValue)
 {
     $castFunction = $this->model[$entityName]["definition"][$entityFieldName]["cast"];
     $check = $this->model[$entityName]["definition"][$entityFieldName]["check"]($testValue, $castFunction);
     if ($entityFieldName == "user_id") {
         index($this->model[$entityName]["definition"]);
     }
     return $check;
 }
Ejemplo n.º 3
0
function connexion()
{
    if (!User::isConnected()) {
        include VIEW . "connexion.php";
        if (isset($_POST['login'])) {
            echo "<p id='mErreur'>Mot de passe ou login erroné</p>";
        }
    } else {
        index();
    }
}
Ejemplo n.º 4
0
 public function show($id = null)
 {
     if (is_null($id)) {
         return index();
     } else {
         $tags = User::find(Auth::user()->id)->tags()->where('tags.id', '=', $id)->first();
         if (is_null($tags)) {
             return PaperworkHelpers::apiResponse(PaperworkHelpers::STATUS_NOTFOUND, array());
         } else {
             return PaperworkHelpers::apiResponse(PaperworkHelpers::STATUS_SUCCESS, $tags);
         }
     }
 }
Ejemplo n.º 5
0
function handle()
{
    header('Content-Type: text/html');
    $base = urldecode($_SERVER['REQUEST_URI']);
    if ($base == '/Biblisches/Grundtext/') {
        index();
        return;
    }
    if (preg_match('/([^-]+)-(\\d+)/', $_GET['v'], $matched)) {
        chapter($matched[1], $matched[2]);
        return;
    }
    print "404. " . link_kapitel_auswahl();
}
Ejemplo n.º 6
0
 public function show($id = null)
 {
     if (is_null($id)) {
         return index();
     } else {
         $shortcuts = DB::table('notebooks')->join('shortcuts', function ($join) {
             $join->on('notebooks.id', '=', 'shortcuts.notebook_id')->where('shortcuts.user_id', '=', Auth::user()->id);
         })->select('notebooks.id', 'notebooks.parent_id', 'notebooks.type', 'notebooks.title', 'shortcuts.id', 'shortcuts.sortkey')->where('notebooks.id', '=', $id)->first();
         if (is_null($shortcuts)) {
             return PaperworkHelpers::apiResponse(PaperworkHelpers::STATUS_NOTFOUND, array());
         } else {
             return PaperworkHelpers::apiResponse(PaperworkHelpers::STATUS_SUCCESS, $shortcuts);
         }
     }
 }
Ejemplo n.º 7
0
function init($conexao)
{
    if (isset($_POST['acao'])) {
        switch ($_POST['acao']) {
            case 'add':
                adicionar($conexao);
                break;
            case 'edit':
                editar($conexao);
                break;
            case 'delete':
                remover($conexao);
                break;
        }
    } else {
        index($conexao);
    }
}
Ejemplo n.º 8
0
function do_upload()
{
    include "classes/Upload.php";
    $config['upload_path'] = './uploads/';
    // $config['allowed_types'] = '';
    $config['max_size'] = '100';
    $UpFile = new Upload($config);
    if (!$UpFile->do_upload()) {
        echo "<span style='color:#ff0000;'>Se ha producido un error</span>";
        index();
    } else {
        $dataFile = $UpFile->data();
        $file = 'uploads/' . $dataFile['file_name'];
        $pass = $_POST['pass'];
        //$output = system('./revtrans.php --password='******' '.$file);
        //printf("System Outputs: $output\n");
        exec('./revtrans.php --password='******' ' . $file, $results);
        //parser mejorable pero bueno
        $results = implode($results);
        $results = str_replace('""', '#', $results);
        $results = str_replace(',', '#', $results);
        $results = str_replace('"', '', $results);
        $results = preg_split("/#/", $results);
        $i = 0;
        $aux = 0;
        $Keys = array();
        foreach ($results as $result) {
            $Keys[$aux][] = $result;
            $i++;
            if ($i == 5) {
                $i = 0;
                $aux++;
            }
        }
        //print_r($Keys);
        $i = 0;
        foreach ($Keys as $Key) {
            if ($i != 0) {
                echo $Key[0] . "=>" . $Key[2] . "<br>";
            }
            $i++;
        }
    }
}
Ejemplo n.º 9
0
function popup_switch()
{
    switch ($_GET["main"]) {
        case "index":
            echo index();
            break;
        case "system":
            echo section_system();
            break;
        case "mail":
            echo section_messaging();
            break;
        case "proxy":
            echo section_proxy();
            break;
        default:
            break;
    }
}
Ejemplo n.º 10
0
         rebuildThemes('boards');
         header('Location: ?/' . $b['uri'] . '/' . $config['file_index'], true, $config['redirect_http']);
     } else {
         $body .= form_newBoard();
         // TODO: Statistics, etc, in the dashboard.
         echo Element('page.html', array('config' => $config, 'title' => 'New board', 'body' => $body, 'mod' => true));
     }
 } elseif (preg_match('/^\\/' . $regex['board'] . '(' . $regex['index'] . '|' . $regex['page'] . ')?$/', $query, $matches)) {
     // Board index
     $boardName =& $matches[1];
     // Open board
     if (!openBoard($boardName)) {
         error($config['error']['noboard']);
     }
     $page_no = empty($matches[2]) || $matches[2] == $config['file_index'] ? 1 : $matches[2];
     if (!($page = index($page_no, $mod))) {
         error($config['error']['404']);
     }
     $page['pages'] = getPages(true);
     $page['pages'][$page_no - 1]['selected'] = true;
     $page['btn'] = getPageButtons($page['pages'], true);
     $page['mod'] = true;
     echo Element('index.html', $page);
 } elseif (preg_match('/^\\/' . $regex['board'] . $regex['res'] . $regex['page'] . '$/', $query, $matches)) {
     // View thread
     $boardName =& $matches[1];
     $thread =& $matches[2];
     // Open board
     if (!openBoard($boardName)) {
         error($config['error']['noboard']);
     }
Ejemplo n.º 11
0
	include_once('ressources/class.templates.inc');
	include_once('ressources/class.users.menus.inc');
	include_once('ressources/class.maincf.multi.inc');
	
	
$users=new usersMenus();
if(!$users->AsPostfixAdministrator){
	$tpl=new templates();
	$ERROR_NO_PRIVS=$tpl->javascript_parse_text("{ERROR_NO_PRIVS}");
	echo "alert('$ERROR_NO_PRIVS');";
	die();
	
}

	if(isset($_GET["popup"])){popup();exit;}
	if(isset($_GET["index"])){index();exit;}
	if(isset($_GET["settings"])){parameters();exit;}
	if(isset($_GET["dnsbl"])){dnsbl();exit;}
	if(isset($_GET["dnsbl-list"])){dnsbl_list();exit;}
	if(isset($_GET["dnsbl-add"])){dnsbl_add();exit;}
	if(isset($_GET["dnsbl-delete"])){dnsbl_delete();exit;}
	if(isset($_GET["postscreen_dnsbl_action"])){saveConfig();exit;}
	if(isset($_GET["postscreen_bare_newline_enable"])){saveConfig();exit;}
	
	
	
	if(isset($_GET["EnablePostScreen"])){EnablePostScreen_edit();exit;}

js();

Ejemplo n.º 12
0
     {
     echo 'Successfully created<br />'."\n";
     echo 'Go to BBS: <a href="../'.$_POST['bbs'].'/index.html">'.$_POST['title'].'</a><br />'."\n";
     if(!file_exists('../'.$_POST['bbs'].'/')) mkdir('../'.$_POST['bbs'].'/',0777);
     if(!file_exists('../'.$_POST['bbs'].'/.htaccess'))
      {
      $fp=fopen('../'.$_POST['bbs'].'/.htaccess','w');
      fwrite($fp,'DirectoryIndex index.html');
      fclose($fp);
      }
     require 'page_elements.php';
     $fp=fopen("../".$_POST['bbs']."/index.html",'w');
     fwrite($fp,head($bbs_name,$_POST['title']));
     fwrite($fp,index_display($bbs_name,$_POST['title'],$bbs['display']));
     fwrite($fp,index_menu($_POST['bbs'],$db_prefix,$menu_n,$index_n));
     fwrite($fp,index($_POST['bbs'],$db_prefix,$index_posts_n,$index_n,$_POST['postname'],$_POST['show_id']));
     fwrite($fp,form($_POST['bbs']));
     fwrite($fp,$foot);
     fclose($fp);

     $fp=fopen("../".$_POST['bbs']."/subback.html",'w');
     fwrite($fp,$head);
     fwrite($fp,index_menu($_POST['bbs'],$db_prefix));
     fwrite($fp,$foot);
     fclose($fp);
     }
    }
   ?>
Create BBS:
<form action="?operate=bbs&action=create" method="post">
<table style="margin-left: auto; margin-right: auto; text-align: left;" border="1">
Ejemplo n.º 13
0
function buildIndex($global_api = "yes")
{
    global $board, $config, $build_pages;
    if (!$config['smart_build']) {
        $pages = getPages();
        if (!$config['try_smarter']) {
            $antibot = create_antibot($board['uri']);
        }
        if ($config['api']['enabled']) {
            $api = new Api();
            $catalog = array();
        }
    }
    for ($page = 1; $page <= $config['max_pages']; $page++) {
        $filename = $board['dir'] . ($page == 1 ? $config['file_index'] : sprintf($config['file_page'], $page));
        $jsonFilename = $board['dir'] . ($page - 1) . '.json';
        // pages should start from 0
        if ((!$config['api']['enabled'] || $global_api == "skip" || $config['smart_build']) && $config['try_smarter'] && isset($build_pages) && !empty($build_pages) && !in_array($page, $build_pages)) {
            continue;
        }
        if (!$config['smart_build']) {
            $content = index($page);
            if (!$content) {
                break;
            }
            // json api
            if ($config['api']['enabled']) {
                $threads = $content['threads'];
                $json = json_encode($api->translatePage($threads));
                file_write($jsonFilename, $json);
                $catalog[$page - 1] = $threads;
            }
            if ($config['api']['enabled'] && $global_api != "skip" && $config['try_smarter'] && isset($build_pages) && !empty($build_pages) && !in_array($page, $build_pages)) {
                continue;
            }
            if ($config['try_smarter']) {
                $antibot = create_antibot($board['uri'], 0 - $page);
                $content['current_page'] = $page;
            }
            $antibot->reset();
            $content['pages'] = $pages;
            $content['pages'][$page - 1]['selected'] = true;
            $content['btn'] = getPageButtons($content['pages']);
            $content['antibot'] = $antibot;
            file_write($filename, Element('index.html', $content));
        } else {
            file_unlink($filename);
            file_unlink($jsonFilename);
        }
    }
    if (!$config['smart_build'] && $page < $config['max_pages']) {
        for (; $page <= $config['max_pages']; $page++) {
            $filename = $board['dir'] . ($page == 1 ? $config['file_index'] : sprintf($config['file_page'], $page));
            file_unlink($filename);
            if ($config['api']['enabled']) {
                $jsonFilename = $board['dir'] . ($page - 1) . '.json';
                file_unlink($jsonFilename);
            }
        }
    }
    // json api catalog
    if ($config['api']['enabled'] && $global_api != "skip") {
        if ($config['smart_build']) {
            $jsonFilename = $board['dir'] . 'catalog.json';
            file_unlink($jsonFilename);
            $jsonFilename = $board['dir'] . 'threads.json';
            file_unlink($jsonFilename);
        } else {
            $json = json_encode($api->translateCatalog($catalog));
            $jsonFilename = $board['dir'] . 'catalog.json';
            file_write($jsonFilename, $json);
            $json = json_encode($api->translateCatalog($catalog, true));
            $jsonFilename = $board['dir'] . 'threads.json';
            file_write($jsonFilename, $json);
        }
    }
    if ($config['try_smarter']) {
        $build_pages = array();
    }
}
Ejemplo n.º 14
0
<?php

require_once "modules/index.php";
require_once "modules/game.php";
$query = $_SERVER['QUERY_STRING'];
$query = split("/", $query);
$module = array_shift($query);
$parameters = $query;
switch ($module) {
    case "g":
        //game
        game($parameters);
        break;
    case "help":
        //help functions
        break;
    default:
        index($parameters);
}
Ejemplo n.º 15
0
function main_switch()
{
    switch ($_GET["main"]) {
        case "index":
            index();
            exit;
            break;
        case "artica_process":
            main_config();
            exit;
            break;
        default:
            break;
    }
}
Ejemplo n.º 16
0
function deletecat()
{
    //pour supprimer une catégorie (fonction appelée par le clic sur "supprimer" dans une ligne du formulaire)
    global $deletecat, $keysommaire, $confirm, $catname, $db, $prefix;
    if ($confirm != "YES") {
        include "header.php";
        GraphicAdmin();
        echo "<br>";
        OpenTable();
        $catname = htmlspecialchars($catname);
        echo "<div align=\"center\">" . _SOMWARNINGDELETECAT . " <i>{$catname}</i> ?<br><br>";
        echo "[ <a href=\"admin.php?op=sommaire\">" . _SOMNO . "</a> | <a href=\"admin.php?op=sommaire&go=deletecat&deletecat={$deletecat}&confirm=YES\">" . _SOMYES . "</a> ]" . "</div>";
        CloseTable();
        include "footer.php";
    } else {
        $confirm = "NO";
        $db->sql_query("DELETE FROM " . $prefix . "_sommaire WHERE groupmenu='{$deletecat}'");
        $db->sql_query("DELETE FROM " . $prefix . "_sommaire_categories WHERE groupmenu='{$deletecat}'");
        echo MySql_error();
        index();
    }
}
Ejemplo n.º 17
0
function postfix_tls_switch()
{
    if ($_GET["tab"] == null) {
        $_GET["tab"] = "tls_table";
    }
    switch ($_GET["tab"]) {
        case "index":
            echo index();
            break;
        case "tls_table":
            echo smtp_tls_policy_maps();
            break;
        case "certificate_infos":
            echo postfix_tls_certificate();
            break;
        case "settings":
            echo postfix_tls_settings();
            break;
        case "relay_clientcerts":
            echo postfix_relay_clientcerts();
            break;
        default:
            echo smtp_tls_policy_maps($_GET["ou"]);
            break;
    }
}
Ejemplo n.º 18
0
<?php

session_start();
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Videoclub</title>
        <meta charset="utf-8" />
    </head>
    <body><?php 
require 'auxiliar.php';
require '../comunes/auxiliar.php';
$columnas = array('numero' => array('bonito' => 'Número', 'criterio' => 'numero', 'exacto' => TRUE), 'dni' => array('bonito' => 'DNI', 'criterio' => 'dni', 'exacto' => TRUE), 'nombre' => array('bonito' => 'Nombre', 'criterio' => 'nombre'), 'direccion' => array('bonito' => 'Dirección', 'criterio' => 'direccion'), 'poblacion_nombre' => array('bonito' => 'Población', 'criterio' => 'poblacion_nombre'), 'provincia_nombre' => array('bonito' => 'Provincia', 'criterio' => 'provincia_nombre'), 'codpostal' => array('bonito' => 'Código postal', 'criterio' => 'codpostal', 'exacto' => TRUE), 'telefono' => array('bonito' => 'Teléfono', 'criterio' => 'telefono', 'exacto' => TRUE));
index($columnas, 'v_socios');
?>
    </body>
</html>

Ejemplo n.º 19
0
     $bot = array("bot", 7, 5, 3, 0, 6, 0);
     if ($noun1[$n][2] == 0 && $noun1[$n][3] == 0) {
         $say = array("Well I don't think being a ", "If I am just a ", "If I'm a ");
         $say2 = array(" is the same as being alive.", " is alive, for starters.", " makes me competent enough to answer that question.", " makes me capable of answering that question.", " allows me to be able to answer that, but I'm a bot so I just did.");
         $rand = rand(0, count($say) - 1);
         $rand2 = rand(0, count($say2) - 1);
         echo $say[$rand] . $noun1[$n][0] . $say2[$rand2];
     } else {
         if ($noun1[$n][2] < 0) {
             $say = array("Thing is I am smarter than this ", "I got more smarts than this ", "I'm smarter than a ");
             $say2 = array(" really I am", "I'm not stupid.", "I'm not dumb what do you take me for?", " so really what you take me for?", " by a long shot.");
             $rand = rand(0, count($say) - 1);
             $rand2 = rand(0, count($say2) - 1);
             echo $say[$rand] . $noun1[$n][0] . $say2[$rand2];
         } else {
             if ((int) llList2String(bot, 6) > (int) index(noun1, i, 7, 6)) {
                 $say = array("But I'm prettier than a ", "Well what about you? are you prettier than a ", "I'm better-looking than a ");
                 $rand = rand(0, count($say) - 1);
                 echo $say[$rand] . $noun1[$n][0];
             }
         }
     }
 } else {
     if ($noun1[$n][1] < -6) {
         $bad = array();
         array_push($bad, "Your love is a ");
         array_push($bad, "In the evening the summer sun burns me like the ");
         array_push($bad, "Eagles attack swiftly like most every ");
         array_push($bad, "Madness is the quality of the ");
         array_push($bad, "Pain and suffering come with every ");
         array_push($bad, "That isn't good, that ");
Ejemplo n.º 20
0
<div id="page-wrapper">
	<div class="col-lg-12">
		<h3 class="page-header">Cursos</h3>
		<table class="table table-bordered table-condensed">
			<thead>
				<tr>
					<th>Nome</th>
					<th>Descrição</th>
					<th>Programa</th>
					<th style="width: auto !important;"></th>
					<th></th>
				</tr>
			</thead>
			<tbody>
				<?php 
$cursos = index($conexao);
foreach ($cursos as $curso) {
    ?>
				<tr>
					<td><?php 
    echo $curso['NOME'];
    ?>
</td>
					<td><?php 
    echo $curso['DESCRICAO'];
    ?>
</td>
					<td><?php 
    echo $curso['PROGRAMA'];
    ?>
</td>
Ejemplo n.º 21
0
	<div class="col-lg-12">
		<h3 class="page-header">Usuários</h3>
		<table class="table table-bordered table-condensed">
			<thead>
				<tr>
					<th>Nome</th>
					<th>Perfil</th>
					<th>E-mail</th>
					<th>Programa</th>
					<th style="width: auto !important;"></th>
					<th></th>
				</tr>
			</thead>
			<tbody>
				<?php 
$usuarios = index($conexao);
foreach ($usuarios as $usuario) {
    ?>
				<tr>
					<td><?php 
    echo $usuario['NOME'];
    ?>
</td>
					<td><?php 
    echo $usuario['PERFIL'];
    ?>
</td>
					<td><?php 
    echo $usuario['EMAIL'];
    ?>
</td>
Ejemplo n.º 22
0
function process($text, $wiki)
{
    global $dataSource;
    global $_EXTRAS;
    global $_CONFIG;
    $text = $text . "\n\n";
    if ($_CONFIG['oneWiki']) {
        $base = $_CONFIG['base'];
    } else {
        $base = $_CONFIG['base'] . "/" . $wiki;
    }
    function stripSpaces($text)
    {
        return ereg_replace("/[:space:]/", "", $text);
    }
    /*// Conditional includes
    	preg_match_all("/\[\[IFEDIT\|(.*?)\]\]/", $text, $matches);
    	foreach($matches[0] as $index => $match){
    		$result = $matches[1][$index];
    		if (checkAuth("edit")){
    			$text = preg_replace("#".preg_quote($match,"#")."#",$result,$text);
    		} else {
    			$text = preg_replace("#".preg_quote($match,"#")."#","Can't Edit",$text);
    		}
    		#$_EXTRAS[$matches[1][$index]] = $matches[2][$index];
    	}
    
    
    	preg_match_all("/\[\[IfLoggedIn\|(.*?)\|(.*?)\]\]/", $text, $matches);
    	foreach($matches[0] as $index => $match){
    		$result = $matches[1][$index];
    		if (isset($_EXTRAS['me'])){
    			$text = preg_replace("#".preg_quote($match,"#")."#",$matches[1][$index],$text);
    		} else {
    			$text = preg_replace("#".preg_quote($match,"#")."#",$matches[2][$index],$text);
    		}
    		#$_EXTRAS[$matches[1][$index]] = $matches[2][$index];
    	}
    
    	preg_match_all("/\[\[IFEDIT\|(.*?)\|(.*?)\]\]/", $text, $matches);
    	foreach($matches[0] as $index => $match){
    		if (checkAuth("edit")){
    			$text = preg_replace("#".preg_quote($match,"#")."#", $matches[1][$index],$text);
    		} else {
    			$text = preg_replace("#".preg_quote($match,"#")."#", $matches[2][$index],$text);
    		}
    		#$_EXTRAS[$matches[1][$index]] = $matches[2][$index];
    	}*/
    preg_match_all("/\\[\\[INCLUDE\\|(.*?)\\]\\]/", $text, $matches);
    foreach ($matches[0] as $index => $match) {
        $include = $dataSource->getContent($matches[1][$index]);
        $text = preg_replace("#" . preg_quote($match, "#") . "#", $include, $text);
    }
    // Set Variables
    preg_match_all("/\\[\\[SETVAR\\|(.*?)\\|(.*?)\\]\\]/", $text, $matches);
    // [[CALC|var|value]]
    foreach ($matches[0] as $index => $match) {
        $text = preg_replace("#" . preg_quote($match, "#") . "#", "", $text);
        $_EXTRAS[$matches[1][$index]] = $matches[2][$index];
    }
    preg_match_all("/\\[\\[CALC\\|(.*?)\\|(.*?)\\]\\]/", $text, $matches);
    // [[CALC|var|opp]]
    foreach ($matches[0] as $index => $match) {
        $text = preg_replace("#" . preg_quote($match, "#") . "#", "<!-- Calculate functions removed -->", $text);
        #$eval = "\$_EXTRAS[".$matches[1][$index]."] = \$_EXTRAS[".$matches[1][$index]."] ".$matches[2][$index].";";
        #eval($eval);
        #$_EXTRAS[$matches[1][$index]] = eval($eval);
    }
    preg_match_all("/\\[\\[RCALC\\|(.*?)\\|(.*?)\\]\\]/", $text, $matches);
    // [[RCALC|ropp|var]]
    foreach ($matches[0] as $index => $match) {
        $text = preg_replace("#" . preg_quote($match, "#") . "#", "<!-- Calculate functions removed -->", $text);
        #$eval = "\$_EXTRAS[".$matches[2][$index]."] = ".$matches[1][$index]." \$_EXTRAS[".$matches[2][$index]."];";
        #eval($eval);
        #$_EXTRAS[$matches[1][$index]] = eval($eval);
    }
    preg_match_all("/\\[\\[VAR\\|(.*?)\\]\\]/", $text, $matches);
    foreach ($matches[0] as $index => $match) {
        $var = $_EXTRAS[$matches[1][$index]];
        $text = preg_replace("#" . preg_quote($match, "#") . "#", $var, $text);
    }
    #$text = preg_replace("/\[\[SEARCH\|(.*?)\]\]/",searchFor($wiki,'\1'), $text);
    #$text = preg_replace("/\[\[ALLBY\|(.*?)\]\]/",searchAuthor($wiki,'\1'), $text);
    if (preg_match("#\\[\\[RECENT\\]\\]#", $text)) {
        $text = str_replace("[[RECENT]]", recent($wiki), $text);
    }
    if (preg_match("/\\[\\[INDEX\\]\\]/", $text)) {
        $text = str_replace("[[INDEX]]", index(), $text);
    }
    preg_match_all("/\\[\\[LOCKED\\|(.*?)\\]\\]/", $text, $matches);
    foreach ($matches[0] as $index => $match) {
        $users = $matches[1][$index];
        doAuth($users, "view this");
        $users_array = explode(',', $users);
        if (count($users_array) == 1) {
            $users_text = $users;
        } else {
            $last = array_pop($users_array);
            $users_text = implode(", ", $users_array) . ' &amp; ' . $last;
        }
        $text = preg_replace("#" . preg_quote($match, "#") . "#", '<div class="locked">Page is locked to ' . $users_text . ' </div>', $text);
    }
    // Search for User
    preg_match_all("/\\[\\[ALLBY\\|(.*?)\\]\\]/", $text, $matches);
    foreach ($matches[0] as $index => $match) {
        $result = author($matches[1][$index]);
        $text = preg_replace("#" . preg_quote($match, "#") . "#", $result, $text);
        #$_EXTRAS[$matches[1][$index]] = $matches[2][$index];
    }
    // Search for Arbitaty
    preg_match_all("/\\[\\[SEARCH\\|(.*?)\\]\\]/", $text, $matches);
    foreach ($matches[0] as $index => $match) {
        $datum = $matches[1][$index];
        $result = $dataSource->search($datum);
        $text = preg_replace("#" . preg_quote($match, "#") . "#", $result, $text);
        #$_EXTRAS[$matches[1][$index]] = $matches[2][$index];
    }
    /*// [[MACRO|macroname|arguments]]
    	preg_match_all("/\[\[MACRO\|(.*?)\|(.*?)\\]\]/", $text, $matches);
    	foreach($matches[0] as $index => $match){
    		#print_r($matches);
    
    		if (file_exists("macros/".$matches[1][$index].".inc")){
    			ob_start();
    			$var = $matches[2][$index];
    			include("macros/".$matches[1][$index].".inc");
    			$return = ob_get_contents();
    			ob_end_clean();
    		} else {
    			$return = "Macro ".$matches[1][$index]." not defined";
    		}
    		
    		$text = preg_replace("#".preg_quote($matches[0][$index],"#")."#",$return,$text);
    		$_EXTRAS[$matches[1][$index]] = $matches[2][$index];
    	}
    
    	// [[MACRO|macroname]]
    	preg_match_all("/\[\[MACRO\|(.*?)\\]\]/", $text, $matches);
    	foreach($matches[0] as $index => $match){
    		#print_r($matches);
    
    		if (file_exists("macros/".$matches[1][$index].".inc")){
    			ob_start();
    			include("macros/".$matches[1][$index].".inc");
    			$return = ob_get_contents();
    			ob_end_clean();
    		} else {
    			$return = "Macro ".$matches[1][$index]." not defined";
    		}
    		
    		$text = preg_replace("#".preg_quote($matches[0][$index],"#")."#",$return,$text);
    		$_EXTRAS[$matches[1][$index]] = $matches[2][$index];
    	}
    	*/
    //New Macros code
    $macros = array();
    // [[MACRO|macroname|arguments]]
    preg_match_all("/\\[\\[MACRO\\|(.*?)\\|(.*?)\\]\\]/", $text, $matches);
    foreach ($matches[0] as $index => $match) {
        #print_r($matches);
        $return = "";
        $macro = $matches[1][$index];
        $command = $matches[2][$index];
        $params = false;
        if ($pos = strpos($command, '|')) {
            $params = explode(',', substr($command, $pos + 1));
            $command = substr($command, 0, $pos);
        }
        debug("Macro: {$macro}: {$command}");
        if (!isset($macros[$macro])) {
            if (file_exists("macros/" . $matches[1][$index] . ".inc")) {
                include "macros/" . $matches[1][$index] . ".inc";
                $macros[$macro] = new $macro($dataSource, $_EXTRAS);
            }
        }
        if (!isset($macros[$macro])) {
            // Macro load failed.
            $return = "*!!Macro " . $matches[1][$index] . " not defined!!*";
        } elseif ($command == "INIT") {
            // Explicit INIT disabled
            //if (file_exists("macros/".$matches[1][$index].".inc")){
            //	include("macros/".$matches[1][$index].".inc");
            //	$macros[$macro] = new $macro($dataSource, $_EXTRAS);
            //} else {
            //	$return = "Macro ".$matches[1][$index]." not defined";
            //}
        } elseif ($command == "LIST") {
            $dir = opendir("macros");
            while ($line = readdir($dir)) {
                if (substr($line, -4) != ".inc") {
                    continue;
                }
                $return .= "* {$line}\n";
            }
        } elseif (!isset($macros[$macro])) {
            $return = "Macro {$macro} used before defined!";
        } elseif (!in_array($command, get_class_methods($macro))) {
            $return = "Macro {$macro} cannot execute {$command}";
        } else {
            #$return = call_user_func(array($macro, $command));
            if ($params) {
                $return = $macros[$macro]->{$command}($params);
            } else {
                $return = $macros[$macro]->{$command}();
            }
        }
        #$text = preg_replace("#".preg_quote($matches[0][$index],"#")."#",$return,$text);
        $text = str_replace($matches[0][$index], $return, $text);
        $_EXTRAS[$matches[1][$index]] = $matches[2][$index];
    }
    // [[MACRO|macroname]]
    // [[CAL|year-mm-dd|Event]]
    preg_match_all("/\\[\\[CAL\\|(....)\\-(..)\\-(..)\\|(.*?)\\]\\]/", $text, $matches);
    $i = 0;
    $calendar = array();
    $caltext = "";
    foreach ($matches[0] as $index => $match) {
        $link = preg_replace("/(\\W)/", "", $matches[4][$index]);
        $text = str_replace($matches[0][$index], "<a name=\"" . $link . "\"></a>", $text);
        $calendar[$matches[1][$index]][$matches[2][$index]][$matches[3][$index]] = $matches[4][$index];
    }
    preg_match_all("/\\[\\[VAR\\|(.*?)\\]\\]/", $text, $matches);
    foreach ($matches[0] as $index => $match) {
        if (isset($_EXTRAS[$matches[1][$index]])) {
            $var = $_EXTRAS[$matches[1][$index]];
        } else {
            $var = '[ERR: ' . $matches[1][$index] . ' Undefined]';
        }
        #$text = preg_replace("#".preg_quote($match,"#")."#",$var, $text);
        $text = str_replace($match, $var, $text);
    }
    foreach ($calendar as $year => $ydata) {
        #ksort($ydata);
        $months = array_keys($ydata);
        foreach (range(min($months), max($months)) as $month) {
            if ($month < 10) {
                $month = "0" . $month;
            }
            #foreach($ydata as $month => $mdata){
            $mdata = $ydata[$month];
            $caltext .= calendar($mdata, $month, $year);
        }
    }
    $links = array();
    /*preg_match_all("/\(\(([.|\|]*?)\)\)/", $text, $matches);
    	foreach($matches[1] as $index => $title){
    		$link = preg_replace("/(\W)/", "", ucwords($matches[2][$index]));
    		$links[] = array($matches[0][$index], $link, $title);
    	}*/
    preg_match_all("/\\(\\((.*?)\\)\\)/", "\n" . $text . "\n", $matches);
    foreach ($matches[1] as $index => $title) {
        if (!strpos($matches[1][$index], "|")) {
            $link = preg_replace("/(\\W)/", "", $title);
            #$links[] = array($matches[0][$index],$link, $title);
        } else {
            $bang = explode("|", $matches[1][$index]);
            $link = preg_replace("/(\\W)/", "", $bang[1]);
            $title = $bang[0];
        }
        if ($title[0] == '~') {
            $link = '~' . $link;
        }
        $links[] = array($matches[0][$index], $link, $title);
    }
    foreach ($links as $index => $matches) {
        $replace = preg_quote($matches[0], '/');
        $stripped = $matches[1];
        $title = $matches[2];
        if ($title[0] == '~') {
            $title = substr($title, 1);
            #$link =  "%(uncreated)".$title."\"?\":".$base."/".$stripped."?action=edit%";
            #$link =  "\"".$title."\":".$base."/".$stripped;
            $link = userLink($title);
        } elseif (!$dataSource->pageExists($stripped)) {
            #$link =  "%(uncreated)".$title."\"?\":".$base."/".$stripped."?action=edit%";
            #$link =  "\"".$title."\":".$base."/".$stripped;
            $link = '<a href="' . $base . "/" . $stripped . '" class="uncreated wiki" title="Uncreated article ' . $title . '">' . $title . '</a>';
        } else {
            #$link =  "\"".$title."\":".$base."/".$stripped;
            $link = '<a href="' . $base . "/" . $stripped . '" class="wiki" title="Internal link to article ' . $title . '">' . $title . '</a>';
        }
        #$link =  "\"".$match."\":".$base."/".$stripped;
        #echo $replace;
        $text = preg_replace("/(\\W|^)" . $replace . "(\\W)/", "\$1{$link}\$2", $text);
        #$text = preg_replace("/(\W|^)".$replace."(\W)/","$1|$replace|$2", $text);
    }
    //preg_match_all("/<aqWikiNoProcess>(.*?)<\/aqwikiNoProcess>/m",$text, $matches);
    $text = str_replace("\n", '[[BR]]', $text);
    $text = str_replace("\r", '', $text);
    preg_match_all("/<aqWikiNoProcess>(.*?)<\\/aqWikiNoProcess>/", $text, $matches);
    foreach ($matches[0] as $index => $match) {
        $id = uniqid();
        $EXTRAS['noProcess'][$id] = $matches[1][$index];
        #$text = preg_replace("#".preg_quote($match,"#")."#",'[[NOPROCESS|'.$id.']]',$text);
        $text = str_replace($match, '[[NOPROCESS|' . $id . ']]', $text);
    }
    $text = str_replace("[[BR]]", "\n", $text);
    $text = textile($text);
    #$text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]\"/]", "<a href=\"\\0\">\\0</a>", $text);
    #$text = preg_replace("#<a href=\"<a href=\"(.*)\">(.*)\"</a>>(.*)</a>#","<a href=\"$1\">$3</a>",$text);
    $text = preg_replace("/\\[CC\\](.*?)\\[CC\\]/", "((\$1))", $text);
    $text = preg_replace("/\\[CMD\\](.*?)\\[CMD\\]/", "[[\$1]]", $text);
    $text = str_replace('[[CAL]]', "<div class=\"calendar\">" . $caltext . "</div>", $text);
    if (!isset($_EXTRAS['textarea'])) {
        $_EXTRAS['textarea'] = "";
    }
    $text = preg_replace("/\\[\\[TEXTAREA\\]\\]/", $_EXTRAS['textarea'], $text);
    $text = str_replace('[[TEXTAREA]]', $_EXTRAS['textarea'], $text);
    preg_match_all("/\\[\\[RAWVAR\\|(.*?)\\]\\]/", $text, $matches);
    foreach ($matches[0] as $index => $match) {
        if (isset($_EXTRAS[$matches[1][$index]])) {
            $var = $_EXTRAS[$matches[1][$index]];
        } else {
            $var = '[ERR: ' . $matches[1][$index] . ' Undefined]';
        }
        $text = str_replace($match, $var, $text);
    }
    preg_match_all("/\\[\\[NOPROCESS\\|(.*?)\\]\\]/", $text, $matches);
    foreach ($matches[0] as $index => $match) {
        $id = $matches[1][$index];
        $text = str_replace($match, $EXTRAS['noProcess'][$id], $text);
    }
    $text = str_replace("[[BR]]", "\n", $text);
    return $text;
}
Ejemplo n.º 23
0
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            <table class="table table-hover">

                <thead class="thead-inverse">
                    <tr>
                        <th class="col-md-1">ID</th>
                        <th class="col-md-3">News Title</th>
                        <th class="col-md-6">News Detail's</th>
                        <th class="col-md-2">Action</th>
                    </tr>
                </thead>

                <tbody>
                    <?php 
$sql = index();
$result = $conn->query($sql);
if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        ?>
                    <tr>
                        <th scope="row" class="col-md-1"><?php 
        echo $row["id"];
        ?>
</th>
                        <td class="col-md-3"><?php 
        echo $row["news_title"];
        ?>
</td>
                        <td class="col-md-6 description"><?php 
        echo $row["news_description"];
Ejemplo n.º 24
0
function main_switch()
{
    switch ($_GET["main"]) {
        case "index":
            index();
            exit;
            break;
        case "yes":
            ntpd_main_config();
            exit;
            break;
        case "logs":
            main_logs();
            exit;
            break;
        case "syncevents":
            main_sync();
            exit;
            break;
        case "conf":
            echo main_conf();
            exit;
            break;
        case "ntpdconf":
            echo main_ntpdconf();
            exit;
            break;
        case "server_list":
            echo main_server_list();
            exit;
            break;
        default:
            break;
    }
}
Ejemplo n.º 25
0
function mysql_main_switch()
{
    $tab = null;
    $users = new usersMenus();
    $sock = new sockets();
    $sock->getFrameWork('cmd.php?SetupCenter=yes');
    $GLOBALS["ArticaMetaDisableSetupCenter"] = $sock->GET_INFO("ArticaMetaDisableSetupCenter");
    if (!isset($_GET["refresh"])) {
        if ($_GET["main"] != "index") {
            echo "\n\t\t\t<input type='hidden' id='main_array_setup_install_selected' value='{$_GET["main"]}'>\n\t\t\t<div style='text-align:right'>" . imgtootltip("refresh-24.png", "{refresh}", "InstallRefresh()") . "</div>\n\t\t\t<div id='main_array_setup_install_{$_GET["main"]}'>";
        }
    }
    switch ($_GET["main"]) {
        case "index":
            echo index();
            break;
        case "smtp_packages":
            echo $tab . smtp_packages();
            break;
        case "stat_packages":
            echo $tab . stat_packages();
            break;
        case "web_packages":
            echo $tab . web_packages();
            break;
        case "proxy_packages":
            echo $tab . proxy_packages();
            break;
        case "samba_packages":
            echo $tab . samba_packages();
            break;
        case "system_packages":
            echo $tab . system_packages();
            break;
        case "xapian_packages":
            echo $tab . xapian_packages();
            break;
        case "service_family":
            echo services_family();
            break;
        default:
            if ($users->POSTFIX_INSTALLED) {
                echo $tab . smtp_packages();
                exit;
            }
            if ($users->SQUID_INSTALLED) {
                echo $tab . proxy_packages();
                exit;
            }
            if ($users->SAMBA_INSTALLED) {
                echo $tab . samba_packages();
                exit;
            }
            echo $tab . system_packages();
            exit;
    }
    if (!isset($_GET["refresh"])) {
        echo "</div>";
    }
}
Ejemplo n.º 26
0
<?php

session_start();
?>

<!DOCTYPE html>

<html lang="es">
    <head>
        <meta charset="UTF-8">
        <title>Gestion de Usuarios</title>
    </head>
    <body><?php 
require '../comunes/auxiliar.php';
conectar();
mostrar_dato_inicial();
comprobar_usuario_admin();
$columnas = array('numero' => array('bonito' => 'Número', 'criterio' => 'numero', 'exacto' => TRUE, 'mostrar' => TRUE), 'nick' => array('bonito' => 'Nick', 'criterio' => 'nick', 'mostrar' => TRUE));
index($columnas, 'usuarios', 'usuarios');
?>
 
    </body>
</html>
Ejemplo n.º 27
0
	include_once('ressources/class.backup.inc');
	
	
	

	$user=new usersMenus();
	if($user->AsAnAdministratorGeneric==false){die('alert("no privileges")');}

if($_GET["dar-index-tab"]=="dar"){echo index_dar();exit;}	
if($_GET["dar-index-tab"]=="rsync"){echo index_rsync();exit;}
if(isset($_GET["perform-run-backup"])){run_backup_perform();exit;}

	
if(isset($_GET["js"])){echo js();exit;}
if(isset($_GET["js-logs"])){echo js();exit;}
if(isset($_GET["index-page"])){echo index();exit;}
if(isset($_GET["dar-settings"])){echo global_settings();exit;}
if(isset($_GET["dar-target"])){echo WhatToBackup();exit;}
if(isset($_GET["dar-params"])){echo dar_settings();exit;}

if(isset($_GET["exclude-types"])){echo dar_exclude_types();exit;}
if(isset($_GET["hsched"])){echo SaveBackupSettings();exit;}
if(isset($_GET["dar_file"])){echo SaveGeneralSettings();exit;}


if(isset($_GET["shares_folders"])){echo SaveBackupSettings();exit;}
if(isset($_GET["exclude-shared-folders"])){echo samba_excludes_shared();exit;}
if(isset($_GET["exclude-homes-folders"])){echo homes_excludes();exit;}

if(isset($_GET["ExcludeSMBFolder"])){samba_excludes_shared_save();exit;}
if(isset($_GET["ExcludeHomesFolder"])){homes_excludes_save();exit;}
Ejemplo n.º 28
0
    exit;
}
if (isset($_POST["start-cicap"])) {
    start();
    exit;
}
if (isset($_POST["restart-cicap"])) {
    restart();
    exit;
}
if (isset($_GET["rows-table"])) {
    events_table();
    exit;
}
if ($_GET["main"] == "index") {
    echo index();
    exit;
}
if ($_GET["main"] == "daemons") {
    echo daemons();
    exit;
}
if ($_GET["main"] == "clamav") {
    echo clamav();
    exit;
}
if ($_GET["main"] == "logs") {
    echo logs();
    exit;
}
if ($_GET["main"] == "status") {
Ejemplo n.º 29
0
    //  for command line operation: index all sites in database
    index_all();
}
if ($all == '2') {
    //  index all new sites, never indexed before
    index_new();
}
if ($all == '3') {
    //  index all erased sites
    index_erased();
}
if ($all == '4') {
    //  'Erase & Re-index all' for command line operation
    erase();
    $log_handle = create_logFile($id);
    index();
}
if ($all == '5') {
    erase();
    //  erase for command line operation
}
if ($all == '6') {
    pre_all();
    //  clear 'last indexed' for command line operation
    die;
}
if ($all == '20') {
    //  index all suspended sites
    index_suspended();
}
if ($all == '21') {
Ejemplo n.º 30
0
        $doc = new XapianDocument();
        $termgenerator->set_document($doc);
        // index each field with a suitable prefix
        $termgenerator->index_text($title, 1, 'S');
        $termgenerator->index_text($description, 1, 'XD');
        // index fields without prefixes for general search
        $termgenerator->index_text($title);
        $termgenerator->increase_termpos();
        $termgenerator->index_text($description);
        // add the collection as a value in slot 0
        $doc->add_value(0, $collection);
        // add the maker as a value in slot 1
        $doc->add_value(1, $maker);
        // store all the fields for display purposes
        $doc->set_data(json_encode($row));
        // we use the identifier to ensure each object ends up
        // in the database only once no matter how many times
        // we run the indexer
        $idterm = "Q" . $identifier;
        $doc->add_boolean_term($idterm);
        $db->replace_document($idterm, $doc);
    }
}
// End of example code
if ($argc != 2) {
    print "Usage: php index_facets.php <source.csv> <target_db_path>\n";
    die;
}
// call the index function
index($argv[1], $argv[2]);