Exemplo n.º 1
0
/**
 * Logs the user out, i.e. destroys all the data stored about them
 */
function user_logout()
{
    global $ezplayer_url;
    // 1) Deleting the ACLs from the session var
    log_append("logout");
    $lvl = $_SESSION['album'] != '' && $_SESSION['asset'] != '' ? 3 : ($_SESSION['album'] != '' ? 2 : 1);
    trace_append(array($lvl, 'logout'));
    acl_exit();
    // 2) Unsetting session vars
    unset($_SESSION['ezplayer_mode']);
    unset($_SESSION['user_login']);
    // User netID
    unset($_SESSION['ezplayer_logged']);
    // "boolean" stating that we're logged
    unset($_SESSION['ezplayer_anonymous']);
    // "boolean" stating that we're logged
    session_destroy();
    // 3) Displaying the logout message
    include_once template_getpath('logout.php');
    //include_once "tmpl/fr/logout.php";
    $url = $ezplayer_url;
    unset($_SESSION['lang']);
}
Exemplo n.º 2
0
 *
 * Copyright (C) 2014 Université libre de Bruxelles
 *
 * Written by Michel Jansens <*****@*****.**>
 * 	      Arnaud Wijns <*****@*****.**>
 *            Carlos Avidmadjessi
 * UI Design by Julien Di Pietrantonio
 *
 * This software is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This software 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
?>

<div id="popup_import_bookmarks" class="reveal-modal">
    <a class="close-reveal-modal">&#215;</a>
<?php 
require_once template_getpath('div_upload_bookmarks.php');
?>
</div>
Exemplo n.º 3
0
/**
 * Displays the flash player
 * @global type $input 
 */
function view_embed()
{
    global $input;
    global $repository_path;
    global $flash_only_browsers;
    global $template_folder;
    global $ezmanager_url;
    // Sanity checks
    if (!isset($input['album']) || !isset($input['asset']) || !isset($input['quality']) || !isset($input['type']) || !isset($input['token'])) {
        echo "Usage: distribute.php?action=embed&amp;album=ALBUM&amp;asset=ASSET&amp;type=TYPE&amp;quality=QUALITY&amp;token=TOKEN<br/>";
        echo "Optional parameters: width: Video width in pixels. height: video height in pixels. iframe: set to true if you want the return code to be an iframe instead of a full HTML page";
        die;
    }
    if (!ezmam_album_exists($input['album'])) {
        error_print_http(404);
        log_append('warning', 'view_embed: tried to access non-existant album ' . $input['album']);
        die;
    }
    if (!ezmam_asset_exists($input['album'], $input['asset'])) {
        error_print_http(404);
        log_append('warning', 'tried to access non-existant asset ' . $input['asset'] . ' of album ' . $input['album']);
        die;
    }
    if (!ezmam_album_token_check($input['album'], $input['token']) && !ezmam_asset_token_check($input['album'], $input['asset'], $input['token'])) {
        error_print_http(403);
        log_append('warning', 'view_media: tried to access asset ' . $input['asset'] . ' from album ' . $input['album'] . ' with invalid token ' . $input['token']);
        die;
    }
    // Then we retrieve the useful information, i.e. the media path and the dimensions
    // Fallback: if the media doesn't exist in the requested quality,
    // we try to find it in another one available
    $media_name = $input['quality'] . '_' . $input['type'];
    if (!ezmam_media_exists($input['album'], $input['asset'], $media_name)) {
        if ($input['quality'] == 'high') {
            $media_name = 'low_' . $input['type'];
        } else {
            if ($input['quality'] == 'low') {
                $media_name = 'high_' . $input['type'];
            }
        }
        // If no quality is available, we tell that to the user.
        if (!ezmam_media_exists($input['album'], $input['asset'], $media_name)) {
            error_print_http(404);
            die;
        }
    }
    $metadata = ezmam_media_metadata_get($input['album'], $input['asset'], $media_name);
    $width = $metadata['width'];
    if (isset($input['width']) && !empty($input['width'])) {
        $width = $input['width'] - 5;
    }
    $height = $metadata['height'];
    if (isset($input['height']) && !empty($input['height'])) {
        $height = $input['height'] - 5;
    }
    $origin = $input['origin'] == 'ezmanager' ? 'ezmanager' : 'embed';
    $media_url = urlencode(ezmam_media_geturl($input['album'], $input['asset'], $media_name) . '&origin=' . $origin);
    $player_url = $ezmanager_url . '/swf/bugatti.swf';
    // And finally we display the player through a template!
    // If the user wanted to have the player in an iframe, we must change the code a little bit
    if (isset($input['iframe']) && $input['iframe'] == 'true') {
        $origin = $input['origin'] == 'ezmanager' ? 'ezmanager' : 'embed';
        echo '<iframe style="padding: 0; z-index: 100;" frameborder="0" scrolling="no" src="distribute.php?action=embed&amp;album=' . $input['album'] . '&amp;asset=' . $input['asset'] . '&amp;type=' . $input['type'] . '&amp;quality=' . $input['quality'] . '&amp;token=' . $input['token'] . '&amp;width=' . $width . '&amp;height=' . $height . '&amp;origin=' . $origin . '" width="' . $width . '" height="' . $height . '"></iframe>';
    } else {
        template_repository_path($template_folder . 'en');
        require_once template_getpath('embed_header.php');
        // We check if the user's browser is a flash-only browser or if it accepts HTML5
        // It's a Flash browser IIF
        // UA includes 'Firefox' OR UA includes 'MSIE' BUT UA does not include 'MSIE 9.'
        // TODO: prepare for future revisions of MSIE
        if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7.') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 8.') !== false) {
            require_once template_getpath('embed_flash.php');
            require_once template_getpath('embed_footer.php');
            die;
        }
        // Otherwise, if it accepts HTML5, we display the HTML5 browser
        require_once template_getpath('embed_html5.php');
        require_once template_getpath('embed_footer.php');
    }
}
Exemplo n.º 4
0
 *            Carlos Avidmadjessi
 * UI Design by Julien Di Pietrantonio
 *
 * This software is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This software 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * EZCAST EZplayer main program (MVC Controller)
 *
 */
/**
 * ezcast podcast manager main program (MVC Controller)
 * @package ezcast.ezplayer.main
 */
require_once 'config.inc';
session_name($appname);
require_once '../commons/lib_template.php';
template_repository_path($template_folder . get_lang());
template_load_dictionnary('translations.xml');
require_once template_getpath('infos.php');
Exemplo n.º 5
0
if ($_SESSION["show_message"]) {
    include_once template_getpath('popup_message_of_day.php');
    ?>
                <script>
                    $('#popup_message_of_day').reveal($(this).data());
                </script>           
            <?php 
}
?>
            <!-- FOOTER - INFOS COPYRIGHT -->
            <?php 
include_once template_getpath('div_main_footer.php');
?>
            <!-- FOOTER - INFOS COPYRIGHT [FIN] -->
        </div><!-- Container fin -->

        <div class="reveal-modal-bg"></div>         
        <?php 
require template_getpath('popup_thread_visibility_choice.php');
?>
        <?php 
require_once template_getpath('popup_import_bookmarks.php');
?>

        <div id="popup_search_result" class="reveal-modal"></div>
        <div id="popup_bookmark" class="reveal-modal"></div>
        <div id="popup_bookmarks" class="reveal-modal"></div>

    </body>
</html>
Exemplo n.º 6
0
/**
 * Sets the stats from the last n days
 * @global array $input
 * @return boolean
 */
function stat_get_by_nDays()
{
    global $input;
    $nDays = $input['nDays'];
    $todayTemp = date('Y-m-d H:i:s');
    $today = $todayTemp;
    $nDaysDate = date('Y-m-d H:i:s', strtotime('-' . $nDays . ' days', strtotime($todayTemp)));
    $resultTrd = threads_count_by_date_interval($nDaysDate, $today);
    $resultCmt = comments_count_by_date_interval($nDaysDate, $today);
    $result = array_merge($resultTrd, $resultCmt);
    if ($result[0]['nbTrd'] == "0") {
        unset($_SESSION['nDaysStats']);
        include_once template_getpath('div_stats_threads_nDays.php');
        return true;
    }
    $_SESSION['nDaysStats']['nDaysEarlier'] = $nDaysDate;
    $_SESSION['nDaysStats']['nDaysLater'] = $today;
    $_SESSION['nDaysStats']['threadsCount'] = $result[0]['nbTrd'];
    $_SESSION['nDaysStats']['commentsCount'] = $result[1]['nbCmt'];
    include_once template_getpath('div_stats_threads_nDays.php');
    return true;
}
Exemplo n.º 7
0
                targetElement = document.getElementById(thingId);
                if (targetElement.style.display == "none")
                {
                    targetElement.style.display = "";
                } else {
                    targetElement.style.display = "none";
                }
            }
        </script>

    </head>
    <body link="#000088" vlink="#000044" alink="#0000ff" <?php 
if ($GLOBALS['debugmode'] == "devl") {
    echo 'background="#99ff99"';
}
?>
>

        <div class="container_ezplayer">
        <?php 
include template_getpath('div_header.php');
?>
            <div id="global">

        <div class="container-fluid">
            <div class="row-fluid">
<?php 
include template_getpath('div_main_menu.php');
?>
                <div class="span9">
Exemplo n.º 8
0
/**
 * Displays the popup with the ulb code to copypaste
 * @global type $input
 * @global type $repository_path
 * @global type $url 
 */
function popup_ulb_code()
{
    global $input;
    global $repository_path;
    $asset_name = $input['asset'];
    ezmam_repository_path($repository_path);
    template_load_dictionnary('translations.xml');
    //
    // Sanity checks
    //
    if (!isset($input['album']) || !isset($input['asset']) || !isset($input['media'])) {
        echo 'Usage: index.php?action=show_popup&amp;popup=ulb_code&amp;album=ALBUM&amp;asset=ASSET&amp;media=MEDIA';
        die;
    }
    if (!ezmam_album_exists($input['album']) || !ezmam_asset_exists($input['album'], $input['asset'])) {
        error_print_message(ezmam_last_error());
        die;
    }
    $ulb_code = get_code_to_media($input['album'], $input['asset'], $input['media']);
    // Displaying the popup
    require_once template_getpath('popup_ulb_code.php');
}
Exemplo n.º 9
0
/**
 * Logs the user out, i.e. destroys all the data stored about them
 */
function user_logout()
{
    global $ezadmin_url;
    // 2) Unsetting session vars
    unset($_SESSION['podcastcours_mode']);
    unset($_SESSION['user_login']);
    // User netID
    unset($_SESSION['podcastcours_logged']);
    // "boolean" stating that we're logged
    session_destroy();
    // 3) Displaying the logout message
    include_once template_getpath('logout.php');
    //include_once "tmpl/fr/logout.php";
    $url = $ezadmin_url;
    unset($_SESSION['lang']);
}
Exemplo n.º 10
0
        foreach ($thread_main_comments as $comment) {
            if ($i != 0) {
                echo '<div class="eom"></div>';
            }
            require template_getpath('div_comment.php');
            $i++;
            $childs = get_comment_childs($thread['comments'], $comment);
            foreach ($childs as $comment) {
                ?>
                    <div  class="<?php 
                echo $comment['level'];
                ?>
">
                        <div class="eom"></div>
                        <?php 
                require template_getpath('div_comment.php');
                ?>
                    </div>
                    <?php 
            }
        }
    }
    ?>

    </div>
    <?php 
}
?>
<div class="form" id="comment_form">
    <div id='comment_form_wrapper'>
        <form action="index.php" method="post" id="submit_comment_form" onsubmit="return false">
Exemplo n.º 11
0
    require template_getpath('div_side_assets.php');
} else {
    require template_getpath('div_side_details.php');
}
?>

</div><!-- div_right END -->

<div id="bottom">
    <!-- bottom part goes here : trending posts, discussions, ... -->                        
    <?php 
if ($_SESSION['ezplayer_mode'] == 'view_album_assets') {
    require template_getpath('div_trending_threads.php');
} else {
    require template_getpath('div_video_description.php');
    if (acl_display_threads() && acl_user_is_logged()) {
        ?>
            <div id="threads" class="threads_info">
            <?php 
        if ($_SESSION['thread_display'] == 'details') {
            include_once template_getpath('div_thread_details.php');
        } else {
            include_once template_getpath('div_threads_list.php');
        }
        ?>
            </div><!-- END of #threads_info -->
        <?php 
    }
}
?>
</div>
Exemplo n.º 12
0
    $('video').bind('webkitfullscreenchange mozfullscreenchange fullscreenchange', function (e) {
        var state = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;
        var fullscreen = state ? true : false;
        if (fullscreen) {
            server_trace(new Array('4', 'browser_fullscreen_enter', current_album, current_asset, duration, time, type, quality));

        } else {
            server_trace(new Array('4', 'browser_fullscreen_exit', current_album, current_asset, duration, time, type, quality));
        }
    });

</script>

<div id="search">
<?php 
include_once template_getpath('div_search.php');
?>
</div>

<div id="side_wrapper">
    <div id="side_menu">

                                                <?php 
if ($is_bookmark) {
    ?>
            <div class="bookmarks_button active"><a href="#asset_bookmarks" onclick="setActivePane('.bookmarks_button');
                    server_trace(new Array('3', 'bookmarks_swap', current_album, current_asset, current_tab));" title="®Display_asset_bookmarks®"></a></div>
                <?php 
}
?>
        <div class='toc_button'><a href="#album_toc" onclick="setActivePane('.toc_button');
Exemplo n.º 13
0
echo $threadsCount;
?>
</b> ®stats_discussions_created®</p>
            <p><b><?php 
echo $commentsCount;
?>
</b> ®stats_comments_created®</p>
        </div>
        <br/>
        <h4>®discussions_comments_by_album®</h4>
        <span class="glyphicon glyphicon-warning-sign">®stats_at_least_one®</span> 
        <div id="pieChartGeneral" class="pie"></div>
        <br />
        <div id="tableGeneral" class="table-responsive">
            <?php 
include_once template_getpath('div_stats_threads_table_generale.php');
?>
        </div>
    </div>
</section>

<!-- M O N T H   S E A R C H -->
<section style="background-color: whitesmoke;" >
    <div class="container">
        <div class="page-header">
            <h2>®stats_month®</h2>
        </div>

        <div id="month-search">
            <input type="text" id="dpMonths" class="input-lg" data-date-format="mm/yyyy" 
                   value="<?php 
Exemplo n.º 14
0
                        show: true,
                        location: 'e'
                    }
                }
        );
    </script>

    <div id="pieChartMonth" class="pie">
        <!-- Chart container -->
    </div>
    <h4><span class="label label-default">Totaux</span></h4>
    <p>®stats_discussions_count®   <span class="label label-default"><?php 
    echo $threadsCountMonth;
    ?>
</span></p>
    <p>®stats_comments_count®   <span class="label label-default"><?php 
    echo $commentsCountMonth;
    ?>
</span></p>
    <div id='tableMonth' class="table-responsive">
        <?php 
    include_once template_getpath('div_stats_threads_table_month.php');
    ?>
    </div>
<?php 
} else {
    echo '<label class="label label-info">NO DATA</label>';
}
?>

Exemplo n.º 15
0
    </div>
    </div>
    </div>
    </div>
        <?php 
include template_getpath('div_footer.php');
?>
    </div>
    <!-- SCRIPTS ------------------------------------------------------- -->
        
        <script>
            
           var nowTemp = new Date();
           var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);
           var monthPicker = $('#dpMonths').datepicker();
        </script>
    <!-- F I N - SCRIPTS ----------------------------------------------- -->
    </body>
</html>
Exemplo n.º 16
0
                        <a  href="#" class="button-rect green pull-right inline-block share-rss" data-reveal-id="popup_share_rss_<?php 
            echo $album['album'];
            ?>
">®subscribe_rss®</a>
                        <?php 
            if (suffix_get($album['album']) == '-priv' || !acl_has_album_moderation($album['album'])) {
                ?>
 
                            <a class="delete-album" title="®Delete_album®" href="#" data-reveal-id="popup_delete_album_<?php 
                echo $index;
                ?>
"></a>
                        <?php 
            }
            ?>
                    </div>

                                    <!--span class="delete_album" onclick="delete_album_token('<?php 
            echo $album['album'];
            ?>
');">x</span-->
                    <?php 
            include template_getpath('popup_delete_album.php');
        }
    }
    ?>
        </ul>
        <?php 
}
?>
</div>
Exemplo n.º 17
0
                                                    <b class="title">Introduction</b>
                                                    <p>Cette section décrit la marche à suivre pour modifier un commentaire.</p>

                                                    <b class="title">Marche à suivre</b>
                                                    <p><b>1.</b> Rendez vous dans le contenu d'une discussion. En-dessous de chaque commentaire dont vous 
                                                        êtes l'auteur se trouve une icone représentant un crayon, à gauche du bouton "Répondre".</p>
                                                    <p><img alt="Editer un commentaire" src="./images/Help_v2/screen_069.png"/></p> 
                                                    <p>En cliquant sur cette icone, le formulaire de réponse se déploie, vous permettant de modifier votre commentaire. 
                                                        Modifiez votre commentaire et soumettez le en cliquant sur "Soumettre".</p>
                                                    <p><img alt="Editer un commentaire" src="./images/Help_v2/screen_070.png"/></p> 

                                                    <b class="title">Remarques</b>
                                                    <p>Lorsque vous éditez un commentaire, tous les votes et approbation des professeurs sont réinitialisés. Cela signifie que 
                                                        si votre commentaire avait été élu meilleure réponse par l'ensemble des votants, elle ne le sera plus suite à votre modification.</p>
                                                    <p>Il est aussi possible de modifier une discussion en respectant les mêmes étapes.</p>
                                                </div>
                                            </li>
                                            </ul>
                                            </div>

                                            </div><!-- div_center END -->
                                            </div><!-- global -->
                                            <!-- FOOTER - INFOS COPYRIGHT -->
                                            <?php 
include_once template_getpath('div_main_footer.php');
?>
                                            <!-- FOOTER - INFOS COPYRIGHT [FIN] -->
                                            </div><!-- Container fin -->
                                            </body>
                                            </html>
Exemplo n.º 18
0
/**
 * Displays the template whose name is $tmpl_name
 * @param string $tmpl_name Template name, including extension
 * @param bool $include_once(true) if set to false, the function will use include instead of include_once
 */
function template_display($tmpl_name, $include_once = false)
{
    require template_getpath($tmpl_name);
}
Exemplo n.º 19
0
function add_first_user()
{
    global $input;
    // Add the first user in database
    $first_user = file_get_contents("../first_user");
    $first_user = explode(" , ", $first_user);
    $user_ID = $first_user[0];
    $surname = $first_user[3];
    $forename = $first_user[2];
    $passwd = $first_user[1];
    $permissions = 1;
    //   try {
    if (!db_ready()) {
        db_prepare();
    }
    db_user_create($user_ID, $surname, $forename, $passwd, $permissions);
    add_admin_to_file($user_ID);
    push_users_to_ezmanager();
    db_log(db_gettable('users'), 'Created user ' . $user_ID, $_SESSION['user_login']);
    db_close();
    //  } catch (PDOException $e) {
    //      $errors['db_error'] = $e->getMessage();
    //      require template_getpath('install.php');
    //      die;
    //  }
    session_destroy();
    unlink("../first_user");
    require template_getpath('install_success.php');
}
Exemplo n.º 20
0
        <div class="form" id="settings_form">
            <div id='settings_form_wrapper'>
                <?php 
include_once template_getpath('div_settings.php');
?>
            </div>
        </div>


        <?php 
if (acl_user_is_logged()) {
    ?>
            <a href="index.php?action=logout" title="®Logout_title®"><span class="logout">®Logout®</span></a>
            <?php 
} else {
    require_once template_getpath('popup_login.php');
    ?>
            <a href="#" data-reveal-id="popup_login" title="®Login_title®"><span class="logout">®Login®</span></a>
        <?php 
}
?>
       
        <span style="float: right; margin: 1px 3px; font-size: 15px;">|</span>
        <a href="index.php?action=view_help" target="_blank" title="®Help_title®"><span class="logout green">®Help®</span></a>
        <span style="float: right; margin: 1px 3px; font-size: 15px;">|</span>
        <?php 
if (acl_user_is_logged()) {
    ?>
            <a id="user-settings" class="pull-right" onclick="javascript:toggle_settings_form()" title="®Preferences_title®">
                <span>®Preferences®</span> 
            </a>