Пример #1
0
                $taille = count(_glob($fichier . '/'));
                $array = array('#CLASS' => $class, '#ID' => $id, '#FICHIER' => $fichier_short, '#TOKEN' => returnToken(), '#SIZE' => $taille, '#NAME' => $nom, '#TITLE' => $title, '#SLASHEDNAME' => addslashes($nom), '#SLASHEDFICHIER' => addslashes($fichier));
                $folderlist .= template($mode . '_folder_' . $layout, $array);
            } elseif ($extension == 'gif' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'png') {
                # Item is a picture
                auto_thumb($fichier, 64, 64);
                $array = array('#CLASS' => $class, '#ID' => $id, '#FICHIER' => $fichier_short, '#TOKEN' => returnToken(), '#SIZE' => $taille, '#NAME' => $nom, '#TITLE' => $title, '#EXTENSION' => $extension, '#ICONE_VISU' => $icone_visu, '#SLASHEDNAME' => addslashes($nom), '#SLASHEDFICHIER' => addslashes($fichier_short));
                $filelist .= template($mode . '_image_' . $layout, $array);
            } elseif ($extension == 'zip') {
                # Item is a zip file=> add change to folder
                $icone_visu = '<a class="tofolder" href="index.php?p=admin&unzip=' . $id . '&token=' . returnToken() . '" title="' . e('Convert this zip file to folder', false) . '">&nbsp;</a>';
                $array = array('#CLASS' => $class, '#ID' => $id, '#FICHIER' => $fichier_short, '#TOKEN' => returnToken(), '#SIZE' => $taille, '#NAME' => $nom, '#TITLE' => $title, '#EXTENSION' => $extension, '#ICONE_VISU' => $icone_visu, '#SLASHEDNAME' => addslashes($nom), '#SLASHEDFICHIER' => addslashes($fichier_short));
                $filelist .= template($mode . '_file_' . $layout, $array);
            } else {
                # all other types
                $array = array('#CLASS' => $class, '#ID' => $id, '#FICHIER' => $fichier_short, '#TOKEN' => returnToken(), '#SIZE' => $taille, '#NAME' => $nom, '#TITLE' => $title, '#EXTENSION' => $extension, '#ICONE_VISU' => $icone_visu, '#SLASHEDNAME' => addslashes($nom), '#SLASHEDFICHIER' => addslashes($fichier_short));
                $filelist .= template($mode . '_file_' . $layout, $array);
            }
        }
    }
    echo $folderlist . $filelist;
    if ($save) {
        store($ids);
    }
    // save in case of new files
} else {
    e('No file on the server');
}
?>
<script src="core/qr.js"></script>
<script>
Пример #2
0
    for ($index = $from; $index < $from + $_SESSION['stats_max_lines']; $index++) {
        //($stats as $client){
        if (!empty($stats[$index])) {
            $log_list .= '
				<tr>
					<td>' . $stats[$index]['date'] . '</td>
					<td>' . $stats[$index]['file'] . ' (
					' . $stats[$index]['id'] . ')</td>
					<td>' . $stats[$index]['ip'] . '</td>
					<td>' . $stats[$index]['referrer'] . '</td>
					<td>' . $stats[$index]['host'] . '</td>
				</tr>';
        }
    }
}
$t = returnToken();
if (!empty($stats[$from + $_SESSION['stats_max_lines']])) {
    $start = $from + $_SESSION['stats_max_lines'];
    $button_next = '<a class="button" href="index.php?p=stats&start=' . $start . '&token=' . $t . '">&#8680;</a>';
}
if ($from > 0) {
    $start = $from - $_SESSION['stats_max_lines'];
    if ($start < 0) {
        $start = 0;
    }
    $button_previous = '<a class="button" href="index.php?p=stats&start=' . $start . '&token=' . $t . '">&#8678;</a>';
}
$nb = count($stats);
$c = 0;
for ($index = 0; $index < $nb; $index += $_SESSION['stats_max_lines']) {
    $c++;
Пример #3
0
  <ul id="list" class="<?php 
echo $_SESSION['aspect'];
?>
 <?php 
echo $_SESSION['mode'];
?>
">
  <?php 
if (!empty($up)) {
    ?>
    <li class="up">
      <a href="index.php?p=admin&amp;path=<?php 
    echo $up;
    ?>
&amp;token=<?php 
    echo returnToken(true);
    ?>
">
        <em>..</em>
      </a>
    </li>
    
  <?php 
}
include_once 'core/listfiles.php';
?>
  
  <script type="text/javascript">
    function get(url){	
      request = new XMLHttpRequest();request.open('GET', url, false);
      request.send();
Пример #4
0
<?php

/**
* BoZoN templates file
* This file handles loading templates and inserting data in it
* Do not change the #CODE parts !
* @author: Bronco (bronco@warriordudimanche.net)
**/
if (function_exists('returnToken')) {
    $token = returnToken();
}
$replacement = array('#tooltip_close' => e('Delete this file', false), '#tooltip_link' => e('Get the share link', false), '#tooltip_qrcode' => e('Get the qrcode of this link', false), '#tooltip_rename' => e('Rename this file (share link will not change)', false), '#tooltip_lock' => e('Put a password on this share', false), '#tooltip_burn' => e('Turn this share into a burn after access share', false), '#tooltip_renew' => e('Regen the share link', false), '#tooltip_zipfolder' => e('Download a zip from this folder', false), '#Move_file_or_folder' => e('Move file or folder', false), '#Move_to' => e('Move to', false), '#Move' => e('Move', false), '#To' => e('To', false), '#Lock_access' => e('Lock access', false), '#Please_give_a_password' => e('Please give a password to lock access to this file', false), '#Rename_file' => e('Rename this file?', false), '#Rename_item' => e('Rename this item?', false), '#Rename' => e('Rename', false), '#Delete_item' => e('Delete this item?', false), '#Delete' => e('Delete', false), '#Share_folder' => e('Share folder', false), '#Share_link' => e('Share link', false), '#share_text' => e('Select the users you want to share with', false), '#Copy_link' => e('Copy this share link', false), '#theme' => THEME_PATH, '#YES' => e('Yes', false), '#Move_to' => e('Move this file to another directory', false), '#Create_new_folder' => e('Create a subfolder', false), '#Create_folder_title' => e('Create a subfolder in this folder', false), '#New_folder' => e('New folder', false), '#paste_url' => e('Paste a file\'s URL', false), '#paste_url_title' => e('Paste a file\'s URL to get it on this server', false), '#Read_m3u_playlist' => e('Read m3u playlist', false), '#local_filename' => e('Force local filename (leave empty=no change)', false), '#filename' => e('filename (optionnal)', false));
if (!empty($token)) {
    $replacement['#TOKEN'] = $token;
}
function load_templates($tpl_array = null)
{
    global $replacement;
    $k = array_keys($replacement);
    $r = array_values($replacement);
    $path = THEME_PATH . '/templates/';
    if (empty($tpl_array)) {
        $tpl_array = _glob($path, $pattern = 'html');
    }
    foreach ($tpl_array as $key => $tpl) {
        $tpl = _basename($tpl);
        $tpl_name = substr($tpl, 0, strlen($tpl) - 5);
        $templates[$tpl_name] = str_replace($k, $r, file_get_contents($path . $tpl));
    }
    return $templates;
}
Пример #5
0
function generate_new_password_link($text = 'Change password')
{
    echo '<a class="auto_restrict_new_password_link" href="index.php?p=login&change_password&token=' . returnToken() . '" alt="link to a new password" title="' . $text . '"><span class="icon-newpass" ></span></a>';
}
Пример #6
0
function make_mode_link($pattern = '<a class="mode_#MODE btn #CLASS" title="#TITLE" href="index.php?p=admin&mode=#MODE&token=#TOKEN">&nbsp;</a>')
{
    if (function_exists('returntoken')) {
        $token = returnToken();
    } else {
        $token = '';
    }
    if ($_SESSION['mode'] == 'view') {
        $class = ' active';
    } else {
        $class = '';
    }
    echo str_replace(array('#MODE', '#TITLE', '#TOKEN', '#CLASS'), array('view', e('Manage files', false), $token, $class), $pattern);
    if ($_SESSION['mode'] == 'links') {
        $class = ' active';
    } else {
        $class = '';
    }
    echo str_replace(array('#MODE', '#TITLE', '#TOKEN', '#CLASS'), array('links', e('Manage links', false), $token, $class), $pattern);
    if ($_SESSION['mode'] == 'move') {
        $class = ' active';
    } else {
        $class = '';
    }
    echo str_replace(array('#MODE', '#TITLE', '#TOKEN', '#CLASS'), array('move', e('Move files', false), $token, $class), $pattern);
}
Пример #7
0
</h2>
					<div class="fil_ariane">
						<a class="home" href="admin.php?path=/&token=<?php 
echo returnToken(true);
?>
"><em><?php 
e('Root');
?>
:</em>&nbsp;</a>
						<?php 
$ariane = explode('/', $_SESSION['current_path']);
$chemin = '';
foreach ($ariane as $nb => $folder) {
    if (!empty($folder)) {
        $chemin .= $folder;
        echo '<a class="ariane_item" href="admin.php?path=' . $chemin . '&token=' . returnToken(true) . '">' . $folder . '</a>';
        $chemin .= '/';
    }
}
?>
					</div>
				</header>
				<ul class="list" id="liste">

					<h1><?php 
echo $_SESSION['filter'];
?>
</h1>
					<?php 
include 'listfiles.php';
?>
Пример #8
0
<body class="<?php 
body_classes();
?>
">
  	<header>
  		<div id="top_bar">
  			<span id="menu">
  				<a class="home" href="index.php" title="<?php 
e('Home');
?>
">&nbsp;</a><?php 
if (is_admin_connected() && empty($_GET['f'])) {
    generate_users_list_link(e('Users list', false));
    generate_new_users_link(e('New user', false));
    generate_new_password_link(e('Change password', false));
    echo '<a class="log_file" href="index.php?p=stats&token=' . returnToken() . '" class="log_link" title="' . e('Access log file', false) . '">&nbsp;</a>';
}
?>
  			</span>
	  		<span id="lang">
		      <?php 
/* you can change the generated link using another pattern as argument (keep the # tags !): 
			'<a #CLASS href="index.php?p=#PAGE&lang=#LANG&token=#TOKEN">#LANG</a>'*/
make_lang_link();
?>
		    </span>
		    <div style="clear:both"></div>
	    </div>
	    
	    <?php 
if (is_admin_connected() && !empty($page) && empty($_GET['f'])) {
Пример #9
0
    include $auto_restrict['path_to_files'] . '/' . $auto_restrict["banned_ip_filename"];
}
/*
 * user tries to login
 */
if (isset($_POST['login']) && isset($_POST['pass']) && empty($_POST['confirm']) && empty($_POST['creation'])) {
    $ok = log_user($_POST['login'], $_POST['pass']);
    if (!$ok) {
        safe_redirect('index.php?p=login&error=2');
    } elseif (isset($_POST['cookie'])) {
        set_cookie();
    }
    // redirect if needed
    if (!empty($auto_restrict['redirect_success'])) {
        if (strpos($auto_restrict['redirect_success'], '&token=') !== false) {
            safe_redirect($auto_restrict['redirect_success'] . '&token=' . returnToken());
        } else {
            safe_redirect($auto_restrict['redirect_success']);
        }
    }
}
/*
 * user wants to logout (?logout $_GET var)
 */
if (isset($_GET['deconnexion']) || isset($_GET['logout'])) {
    @session_destroy();
    delete_cookie();
    exit_redirect();
}
/*
 * no user connected -> login
Пример #10
0
            if (!is_dir(dirname('thumbs/' . $_SESSION['upload_root_path'] . $_SESSION['upload_user_path'] . $destination))) {
                mkdir(dirname('thumbs/' . $_SESSION['upload_root_path'] . $_SESSION['upload_user_path'] . $destination), 0744, true);
            }
            rename(get_thumbs_name($file), get_thumbs_name($destination));
            // changer le chemin dans l'id
            $id = file2id($file);
            $ids = unstore();
            $ids[$id] = $destination;
            store($ids);
        }
    }
    header('location:index.php?p=admin&token=' . returnToken());
    exit;
}
// protéger un dossier avec un mot de passe
if (!empty($_POST['password']) && !empty($_POST['id']) && is_owner($_POST['id'])) {
    $id = $_POST['id'];
    $file = id2file($id);
    $password = blur_password($_POST['password']);
    // turn normal share id into password hashed id
    $ids = unstore();
    unset($ids[$id]);
    $ids[$password . $id] = $file;
    store($ids);
    header('location:index.php?p=admin&token=' . returnToken());
    exit;
}
if ($_FILES) {
    include 'core/auto_dropzone.php';
    exit;
}
Пример #11
0
    exit;
}
?>

	<nav id="menu">
		<div id="menu_icon" >&nbsp;</div>
		<div style="clear:both"></div>
		<div class="lang">
			<?php 
foreach ($lang as $l => $content) {
    if ($_SESSION['language'] == $l) {
        $class = ' class="active" ';
    } else {
        $class = '';
    }
    echo '<a ' . $class . ' href="admin.php?lang=' . $l . '&token=' . returnToken() . '">' . $l . '</a>';
}
?>
			<a href="admin.php?aspect=icon&token=<?php 
newToken(true);
?>
" title=" <?php 
e('Icons');
?>
"><img src="design/<?php 
echo $_SESSION['theme'];
?>
/img/34.png"/></a>
			<a href="admin.php?aspect=list&token=<?php 
newToken(true);
?>
Пример #12
0
function generate_new_users_link($text = 'Add a user')
{
    if (!is_user_admin()) {
        return false;
    }
    echo '<a class="auto_restrict_new_user_link" href="index.php?p=login&newuser&token=' . returnToken() . '" alt="link to a new user" title="' . $text . '">&nbsp;</a>';
}
Пример #13
0
function generate_new_password_link($text = 'Change password')
{
    if (!is_user_admin()) {
        return false;
    }
    echo '<a class="auto_restrict_new_password_link" href="index.php?p=login&change_password&token=' . returnToken() . '" alt="link to a new password" title="' . $text . '">&nbsp;</a>';
}