示例#1
0
function cdnplus_admin_menu($menu)
{
    global $page, $conf;
    if (!empty($conf['cdnplus_conf']['cdn_enabled']) && empty($conf['cdnplus_conf']['cdn_1']['host']) and in_array($page['page'], array('intro', 'plugins_list'))) {
        $page['errors'][] = l10n('You need to set your CDN host');
    }
    $admin_url = get_admin_plugin_menu_link(dirname(__FILE__) . '/admin.php');
    array_push($menu, array('NAME' => 'CDNPlus', 'URL' => get_admin_plugin_menu_link(dirname(__FILE__)) . '/admin.php'));
    return $menu;
}
示例#2
0
function forecast_admin_menu($menu)
{
    array_push($menu, array('NAME' => 'Forecast', 'URL' => get_admin_plugin_menu_link(dirname(__FILE__) . '/admin.php')));
    return $menu;
}
示例#3
0
}
// Check access and exit when user status is not ok
check_status(ACCESS_ADMINISTRATOR);
// Setup plugin Language
load_language('plugin.lang', VIDEOJS_PATH);
// Fetch the template.
global $template, $conf, $lang;
include_once PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php';
// Add the template to the global template
$template->set_filename('plugin_admin_content', dirname(__FILE__) . '/admin.tpl');
if (!isset($_GET['tab'])) {
    $page['tab'] = 'config';
} else {
    $page['tab'] = $_GET['tab'];
}
$my_base_url = get_admin_plugin_menu_link(__FILE__);
$tabsheet = new tabsheet();
// Configuration Tab
$tabsheet->add('config', l10n('Configuration'), add_url_params($my_base_url, array('tab' => 'config')));
// Disable sync if global setting say so, http://piwigo.org/forum/viewtopic.php?id=22376
if ($conf['enable_synchronization']) {
    $tabsheet->add('sync', l10n('Synchronize'), add_url_params($my_base_url, array('tab' => 'sync')));
}
// Tab to handle external video like Vimeo or YouTube via videosjs-plugins
// https://github.com/videojs/video.js/wiki/Plugins
//$tabsheet->add( 'tech', l10n('Add video'), add_url_params( $my_base_url, array('tab'=>'tech') ) );
$tabsheet->select($page['tab']);
$tabsheet->assign();
$my_base_url = $tabsheet->sheets[$page['tab']]['url'];
$template->set_filename('tab_data', dirname(__FILE__) . '/admin_' . $page['tab'] . '.tpl');
include_once dirname(__FILE__) . '/admin_' . $page['tab'] . '.php';
示例#4
0
function Register_PhpBB_admin_menu($menu)
{
    array_push($menu, array('NAME' => 'Register PhpBB', 'URL' => get_admin_plugin_menu_link(REGPHPBB_PATH . 'admin/admin.php')));
    return $menu;
}
示例#5
0
function Audit_PWG_PhpBB()
{
    global $page, $conf, $errors;
    $conf_Register_PhpBB = isset($conf['Register_PhpBB']) ? explode(";", $conf['Register_PhpBB']) : array();
    $page_Register_PhpBB_admin = get_admin_plugin_menu_link(__FILE__);
    $msg_error_PWG_Dup = '';
    $msg_error_PhpBB_Dup = '';
    $msg_error_Link_Break = '';
    $msg_error_Link_Bad = '';
    $msg_error_Synchro = '';
    $msg_ok_Synchro = '';
    $msg_error_PWG2PhpBB = '';
    $msg_error_PhpBB2PWG = '';
    $query = "\nSELECT COUNT(*) AS nbr_dup, id, username\nFROM " . USERS_TABLE . "\nGROUP BY BINARY username\nHAVING COUNT(*) > 1\n;";
    $result = pwg_query($query);
    while ($row = pwg_db_fetch_assoc($result)) {
        $msg_error_PWG_Dup .= '<br>' . l10n('Error_PWG_Dup') . $row['nbr_dup'] . ' x ' . stripslashes($row['username']);
    }
    if ($msg_error_PWG_Dup == '') {
        array_push($page['infos'], l10n('Audit_PWG_Dup') . '<br>' . l10n('Audit_OK'));
    } else {
        $msg_error_PWG_Dup = l10n('Audit_PWG_Dup') . $msg_error_PWG_Dup . '<br>' . l10n('Advise_PWG_Dup');
    }
    $query = "\nSELECT COUNT(*) AS nbr_dup, username\nFROM " . PhpBB_USERS_TABLE . "\nGROUP BY BINARY username\nHAVING COUNT(*) > 1\n;";
    $result = pwg_query($query);
    while ($row = pwg_db_fetch_assoc($result)) {
        $msg_error_PhpBB_Dup .= '<br>' . l10n('Error_PhpBB_Dup') . $row['nbr_dup'] . ' x ' . stripslashes($row['username']);
        $subquery = "\nSELECT user_id, username, user_email\nFROM " . PhpBB_USERS_TABLE . "\nWHERE BINARY username = BINARY '" . $row['username'] . "'\n;";
        $subresult = pwg_query($subquery);
        while ($subrow = pwg_db_fetch_assoc($subresult)) {
            $msg_error_PhpBB_Dup .= '<br>id:' . $subrow['user_id'] . '=' . stripslashes($subrow['username']) . ' (' . $subrow['user_email'] . ')';
            $msg_error_PhpBB_Dup .= ' <a href="';
            $msg_error_PhpBB_Dup .= add_url_params($page_Register_PhpBB_admin, array('action' => 'del_user', 'user_id' => $subrow['user_id']));
            $msg_error_PhpBB_Dup .= '" title="' . l10n('Del_User') . stripslashes($subrow['username']) . '"';
            $msg_error_PhpBB_Dup .= $conf_Register_PhpBB[3] == 'false' ? ' onclick="return confirm(\'' . l10n('Are you sure?') . '\');" ' : ' ';
            $msg_error_PhpBB_Dup .= '><img src="' . REGPHPBB_PATH . '/admin/template/icon/user_delete.png" alt="' . l10n('Del_User') . $subrow['username'] . '" /></a>';
        }
    }
    if ($msg_error_PhpBB_Dup == '') {
        array_push($page['infos'], l10n('Audit_PhpBB_Dup') . '<br>' . l10n('Audit_OK'));
    } else {
        $msg_error_PhpBB_Dup = l10n('Audit_PhpBB_Dup') . $msg_error_PhpBB_Dup . '<br>' . l10n('Advise_PhpBB_Dup');
    }
    $query = "\nSELECT pwg.id as pwg_id, bb.user_id as bb_id, pwg.username as pwg_user, pwg.mail_address as pwg_mail\nFROM " . PhpBB_USERS_TABLE . " AS bb, " . USERS_TABLE . " as pwg\nWHERE bb.user_id NOT in (\n  SELECT id_user_PhpBB\n  FROM " . Register_PhpBB_ID_TABLE . "\n  )\nAND pwg.id NOT in (\n  SELECT id_user_pwg\n  FROM " . Register_PhpBB_ID_TABLE . "\n  )\nAND pwg.username = bb.username\nAND pwg.mail_address = bb.user_email\n;";
    $result = pwg_query($query);
    while ($row = pwg_db_fetch_assoc($result)) {
        $msg_error_Link_Break .= '<br>' . l10n('Error_Link_Break') . stripslashes($row['pwg_user']) . ' (' . $row['pwg_mail'] . ')';
        $msg_error_Link_Break .= ' <a href="';
        $msg_error_Link_Break .= add_url_params($page_Register_PhpBB_admin, array('action' => 'new_link', 'pwg_id' => $row['pwg_id'], 'bb_id' => $row['bb_id']));
        $msg_error_Link_Break .= '" title="' . l10n('New_Link') . stripslashes($row['pwg_user']) . '"';
        $msg_error_Link_Break .= $conf_Register_PhpBB[3] == 'false' ? ' onclick="return confirm(\'' . l10n('Are you sure?') . '\');" ' : ' ';
        $msg_error_Link_Break .= '><img src="' . REGPHPBB_PATH . '/admin/template/icon/link_break.png" alt="' . l10n('New_Link') . stripslashes($row['pwg_user']) . '" /></a>';
    }
    if ($msg_error_Link_Break == '') {
        array_push($page['infos'], l10n('Audit_Link_Break') . '<br>' . l10n('Audit_OK'));
    } else {
        $msg_error_Link_Break = l10n('Audit_Link_Break') . $msg_error_Link_Break;
    }
    $query = "\nSELECT pwg.username as pwg_user, pwg.id as pwg_id, pwg.mail_address as pwg_mail, bb.user_id as bb_id, bb.username as bb_user, bb.user_email as bb_mail\nFROM " . PhpBB_USERS_TABLE . " AS bb\nINNER JOIN " . Register_PhpBB_ID_TABLE . " AS link ON link.id_user_PhpBB = bb.user_id\nINNER JOIN " . USERS_TABLE . " as pwg ON link.id_user_pwg = pwg.id\nWHERE pwg.username <> bb.username\n;";
    $result = pwg_query($query);
    while ($row = pwg_db_fetch_assoc($result)) {
        $msg_error_Link_Bad .= '<br>' . l10n('Error_Link_Del') . stripslashes($row['pwg_user']) . ' (' . $row['pwg_mail'] . ')' . ' -- ' . stripslashes($row['bb_user']) . ' (' . $row['bb_mail'] . ')';
        $msg_error_Link_Bad .= ' <a href="';
        $msg_error_Link_Bad .= add_url_params($page_Register_PhpBB_admin, array('action' => 'link_del', 'pwg_id' => $row['pwg_id'], 'bb_id' => $row['bb_id']));
        $msg_error_Link_Bad .= '" title="' . l10n('Link_Del') . stripslashes($row['pwg_user']) . ' -- ' . stripslashes($row['bb_user']) . '"';
        $msg_error_Link_Bad .= $conf_Register_PhpBB[3] == 'false' ? ' onclick="return confirm(\'' . l10n('Are you sure?') . '\');" ' : ' ';
        $msg_error_Link_Bad .= '><img src="' . REGPHPBB_PATH . '/admin/template/icon/link_delete.png" alt="' . l10n('Link_Del') . stripslashes($row['pwg_user']) . ' -- ' . stripslashes($row['bb_user']) . '" /></a>';
        $msg_error_Link_Bad .= ' -- <a href="';
        $msg_error_Link_Bad .= add_url_params($page_Register_PhpBB_admin, array('action' => 'sync_user', 'username' => stripslashes($row['pwg_user'])));
        $msg_error_Link_Bad .= '" title="' . l10n('Sync_User') . stripslashes($row['pwg_user']) . ' --> ' . stripslashes($row['bb_user']) . '"';
        $msg_error_Link_Bad .= $conf_Register_PhpBB[3] == 'false' ? ' onclick="return confirm(\'' . l10n('Are you sure?') . '\');" ' : ' ';
        $msg_error_Link_Bad .= '><img src="' . REGPHPBB_PATH . '/admin/template/icon/arrow_switch.png" alt="' . l10n('Sync_User') . stripslashes($row['pwg_user']) . ' --> ' . stripslashes($row['bb_user']) . '" /></a>';
    }
    $query = "\nSELECT COUNT(*) as nbr_dead\nFROM " . Register_PhpBB_ID_TABLE . " AS Link\nWHERE id_user_PhpBB NOT IN (\n  SELECT user_id\n  FROM " . PhpBB_USERS_TABLE . "\n  )\nOR id_user_pwg NOT IN (\n  SELECT id\n  FROM " . USERS_TABLE . "\n  )\n;";
    $Compteur = pwg_db_fetch_assoc(pwg_query($query));
    if (!empty($Compteur) and $Compteur['nbr_dead'] > 0) {
        $msg_error_Link_Bad .= '<br>' . l10n('Error_Link_Dead') . $Compteur['nbr_dead'];
        $msg_error_Link_Bad .= ' <a href="';
        $msg_error_Link_Bad .= add_url_params($page_Register_PhpBB_admin, array('action' => 'link_dead'));
        $msg_error_Link_Bad .= '" title="' . l10n('Link_Dead') . $Compteur['nbr_dead'] . '"';
        $msg_error_Link_Bad .= $conf_Register_PhpBB[3] == 'false' ? ' onclick="return confirm(\'' . l10n('Are you sure?') . '\');" ' : ' ';
        $msg_error_Link_Bad .= '><img src="' . REGPHPBB_PATH . '/admin/template/icon/link_delete.png" alt="' . l10n('Link_Dead') . $Compteur['nbr_dead'] . '" /></a>';
    }
    $query = "\nSELECT COUNT(*) AS nbr_dup, pwg.id AS pwg_id, pwg.username AS pwg_user, bb.username AS bb_user, bb.user_id AS bb_id\nFROM " . PhpBB_USERS_TABLE . " AS bb\nINNER JOIN " . Register_PhpBB_ID_TABLE . " AS link ON link.id_user_PhpBB = bb.user_id\nINNER JOIN " . USERS_TABLE . " as pwg ON link.id_user_pwg = pwg.id\nGROUP BY link.id_user_pwg, link.id_user_PhpBB\nHAVING COUNT(*) > 1\n;";
    $result = pwg_query($query);
    while ($row = pwg_db_fetch_assoc($result)) {
        $msg_error_Link_Bad .= '<br>' . l10n('Error_Link_Dup') . $row['nbr_dup'] . ' = ' . stripslashes($row['pwg_user']) . ' -- ' . stripslashes($row['bb_user']) . ')';
        $msg_error_Link_Bad .= ' <a href="';
        $msg_error_Link_Bad .= add_url_params($page_Register_PhpBB_admin, array('action' => 'new_link', 'pwg_id' => $row['pwg_id'], 'bb_id' => $row['bb_id']));
        $msg_error_Link_Bad .= '" title="' . l10n('Link_Dup') . stripslashes($row['pwg_user']) . ' -- ' . stripslashes($row['bb_user']) . '"';
        $msg_error_Link_Bad .= $conf_Register_PhpBB[3] == 'false' ? ' onclick="return confirm(\'' . l10n('Are you sure?') . '\');" ' : ' ';
        $msg_error_Link_Bad .= '><img src="' . REGPHPBB_PATH . '/admin/template/icon/link_error.png" alt="' . l10n('Link_Dup') . stripslashes($row['pwg_user']) . ' -- ' . stripslashes($row['bb_user']) . '" /></a>';
    }
    if ($msg_error_Link_Bad == '') {
        array_push($page['infos'], l10n('Audit_Link_Bad') . '<br>' . l10n('Audit_OK'));
    } else {
        $msg_error_Link_Bad = l10n('Audit_Link_Bad') . $msg_error_Link_Bad;
    }
    $query = "\nSELECT pwg.username as username, pwg.password as pwg_pwd, pwg.mail_address as pwg_eml, PhpBB.user_password as bb_pwd, PhpBB.user_email as bb_eml\nFROM " . PhpBB_USERS_TABLE . " AS PhpBB\nINNER JOIN " . Register_PhpBB_ID_TABLE . " AS link ON link.id_user_PhpBB = PhpBB.user_id\nINNER JOIN " . USERS_TABLE . " as pwg ON link.id_user_pwg = pwg.id\nAND BINARY pwg.username = BINARY PhpBB.username\nORDER BY LOWER(pwg.username)\n;";
    $result = pwg_query($query);
    while ($row = pwg_db_fetch_assoc($result)) {
        if ($row['pwg_pwd'] != $row['bb_pwd'] or $row['pwg_eml'] != $row['bb_eml']) {
            $msg_error_Synchro .= '<br>' . l10n('Error_Synchro') . stripslashes($row['username']);
            $msg_error_Synchro .= ' <a href="';
            $msg_error_Synchro .= add_url_params($page_Register_PhpBB_admin, array('action' => 'sync_user', 'username' => stripslashes($row['username'])));
            $msg_error_Synchro .= '" title="' . l10n('Sync_User') . stripslashes($row['username']) . '"';
            $msg_error_Synchro .= $conf_Register_PhpBB[3] == 'false' ? ' onclick="return confirm(\'' . l10n('Are you sure?') . '\');" ' : ' ';
            $msg_error_Synchro .= '><img src="' . REGPHPBB_PATH . '/admin/template/icon/user_refresh.png" alt="' . l10n('Sync_User') . stripslashes($row['username']) . '" /></a>';
            if ($row['pwg_pwd'] != $row['bb_pwd']) {
                $msg_error_Synchro .= '<br>' . l10n('Error_Synchro_Pswd');
            }
            if ($row['pwg_eml'] != $row['bb_eml']) {
                $msg_error_Synchro .= '<br>' . l10n('Error_Synchro_Mail') . '<br>-- PWG = ' . $row['pwg_eml'] . '<br>-- PhpBB = ' . $row['bb_eml'];
            }
        } else {
            if ($conf_Register_PhpBB[4] == 'true') {
                $msg_ok_Synchro .= '<br> - ' . stripslashes($row['username']) . ' (' . $row['pwg_eml'] . ')' . l10n('Audit_Synchro_OK');
            }
        }
    }
    if ($msg_error_Synchro != '') {
        $msg_error_Synchro = l10n('Audit_Synchro') . $msg_error_Synchro;
    }
    if ($msg_ok_Synchro != '') {
        if ($msg_error_Synchro != '') {
            array_push($page['infos'], l10n('Audit_Synchro') . $msg_ok_Synchro . '<br><br>');
        } else {
            array_push($page['infos'], l10n('Audit_Synchro') . $msg_ok_Synchro . '<br><br>' . l10n('Audit_OK'));
        }
    }
    $query = "\nSELECT username, mail_address FROM " . USERS_TABLE . "\nWHERE BINARY username <> BINARY 'guest'\nAND id not in (\n  SELECT id_user_pwg FROM " . Register_PhpBB_ID_TABLE . "\n  )\nAND BINARY username not in (\n  SELECT username FROM " . PhpBB_USERS_TABLE . "\n  )\nORDER BY LOWER(username)\n;";
    $result = pwg_query($query);
    while ($row = pwg_db_fetch_assoc($result)) {
        $msg_error_PWG2PhpBB .= '<br>' . l10n('Error_PWG2PhpBB') . stripslashes($row['username']) . ' (' . $row['mail_address'] . ')';
        $msg_error_PWG2PhpBB .= ' <a href="';
        $msg_error_PWG2PhpBB .= add_url_params($page_Register_PhpBB_admin, array('action' => 'add_user', 'username' => stripslashes($row['username'])));
        $msg_error_PWG2PhpBB .= '" title="' . l10n('Add_User') . stripslashes($row['username']) . '" ';
        $msg_error_PWG2PhpBB .= $conf_Register_PhpBB[3] == 'false' ? ' onclick="return confirm(\'' . l10n('Are you sure?') . '\');" ' : ' ';
        $msg_error_PWG2PhpBB .= '><img src="' . REGPHPBB_PATH . '/admin/template/icon/user_add.png" alt="' . l10n('Add_User') . stripslashes($row['username']) . '" /></a>';
    }
    if ($msg_error_PWG2PhpBB == '') {
        array_push($page['infos'], l10n('Audit_PWG2PhpBB') . '<br>' . l10n('Audit_OK'));
    } else {
        $msg_error_PWG2PhpBB = l10n('Audit_PWG2PhpBB') . $msg_error_PWG2PhpBB;
    }
    $query = "\nSELECT user_id, username, user_email FROM " . PhpBB_USERS_TABLE . "\nWHERE BINARY username <> BINARY '" . $conf_Register_PhpBB[2] . "'\nAND user_id not in (\n  SELECT id_user_PhpBB FROM " . Register_PhpBB_ID_TABLE . "\n  )\nAND BINARY username not in (\n  SELECT username FROM " . USERS_TABLE . "\n  )\nORDER BY LOWER(username)\n;";
    $result = pwg_query($query);
    while ($row = pwg_db_fetch_assoc($result)) {
        $msg_error_PhpBB2PWG .= '<br>' . l10n('Error_PhpBB2PWG') . stripslashes($row['username']) . ' (' . $row['user_email'] . ')';
        $msg_error_PhpBB2PWG .= ' <a href="';
        $msg_error_PhpBB2PWG .= add_url_params($page_Register_PhpBB_admin, array('action' => 'del_user', 'user_id' => $row['user_id']));
        $msg_error_PhpBB2PWG .= '" title="' . l10n('Del_User') . stripslashes($row['username']) . '"';
        $msg_error_PhpBB2PWG .= $conf_Register_PhpBB[3] == 'false' ? ' onclick="return confirm(\'' . l10n('Are you sure?') . '\');" ' : ' ';
        $msg_error_PhpBB2PWG .= '><img src="' . REGPHPBB_PATH . '/admin/template/icon/user_delete.png" alt="' . l10n('Del_User') . stripslashes($row['username']) . '" /></a>';
    }
    if ($msg_error_PhpBB2PWG == '') {
        array_push($page['infos'], l10n('Audit_PhpBB2PWG') . '<br>' . l10n('Audit_OK'));
    } else {
        $msg_error_PhpBB2PWG = l10n('Audit_PhpBB2PWG') . $msg_error_PhpBB2PWG;
    }
    if ($msg_error_PWG_Dup != '') {
        $errors[] = $msg_error_PWG_Dup . (($msg_error_PhpBB_Dup == '' and $msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>');
    }
    if ($msg_error_PhpBB_Dup != '') {
        $errors[] = $msg_error_PhpBB_Dup . (($msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>');
    }
    if ($msg_error_Link_Break != '') {
        $errors[] = $msg_error_Link_Break . (($msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>');
    }
    if ($msg_error_Link_Bad != '') {
        $errors[] = $msg_error_Link_Bad . (($msg_error_Synchro == '' and $msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>');
    }
    if ($msg_error_Synchro != '') {
        $errors[] = $msg_error_Synchro . (($msg_error_PWG2PhpBB == '' and $msg_error_PhpBB2PWG == '') ? '' : '<br><br>');
    }
    if ($msg_error_PWG2PhpBB != '') {
        $errors[] = $msg_error_PWG2PhpBB . ($msg_error_PhpBB2PWG == '' ? '' : '<br><br>');
    }
    if ($msg_error_PhpBB2PWG != '') {
        $errors[] = $msg_error_PhpBB2PWG;
    }
}
示例#6
0
function eml_admin_menu($menu)
{
    array_push($menu, array('NAME' => 'Extend Mail Link', 'URL' => get_admin_plugin_menu_link(dirname(__FILE__)) . '/admin.php'));
    return $menu;
}
示例#7
0
function vjs_admin_menu($menu)
{
    array_push($menu, array('NAME' => 'VideoJS', 'URL' => get_admin_plugin_menu_link(dirname(__FILE__) . '/admin.php')));
    return $menu;
}
function osm_admin_menu($menu)
{
    array_push($menu, array('NAME' => '<span class="osm-globe"></span>OpenStreetMap', 'URL' => get_admin_plugin_menu_link(dirname(__FILE__) . '/admin.php')));
    return $menu;
}