Beispiel #1
0
function social_bookmarks_initialize()
{
    global $CONFIG, $JS, $lang_plugin_social_bookmarks, $social_bookmarks_icon_array;
    $superCage = Inspekt::makeSuperCage();
    if (in_array('js/jquery.spinbutton.js', $JS['includes']) != TRUE) {
        $JS['includes'][] = 'js/jquery.spinbutton.js';
    }
    if (in_array('plugins/social_bookmarks/script.js', $JS['includes']) != TRUE) {
        $JS['includes'][] = 'plugins/social_bookmarks/script.js';
    }
    require_once "./plugins/social_bookmarks/lang/english.php";
    if ($CONFIG['lang'] != 'english' && file_exists("./plugins/social_bookmarks/lang/{$CONFIG['lang']}.php")) {
        require_once "./plugins/social_bookmarks/lang/{$CONFIG['lang']}.php";
    }
    if ($CONFIG['enable_menu_icons'] >= 1) {
        $social_bookmarks_icon_array['configure'] = '<img src="./plugins/social_bookmarks/images/icons/configure.png" border="0" width="16" height="16" alt="" class="icon" />';
        $social_bookmarks_icon_array['menu'] = '<img src="./plugins/social_bookmarks/images/icons/social_bookmarks.png" border="0" width="16" height="16" alt="" class="icon" />';
    } else {
        $social_bookmarks_icon_array['configure'] = '';
        $social_bookmarks_icon_array['menu'] = '';
    }
    if ($CONFIG['enable_menu_icons'] == 2) {
        $social_bookmarks_icon_array['page'] = '<img src="./plugins/social_bookmarks/images/icons/social_bookmarks.png" border="0" width="16" height="16" alt="" class="icon" />';
    } else {
        $social_bookmarks_icon_array['page'] = '';
    }
    $social_bookmarks_icon_array['announcement'] = cpg_fetch_icon('announcement', 1);
    $social_bookmarks_icon_array['ok'] = cpg_fetch_icon('ok', 0);
    $social_bookmarks_icon_array['cancel'] = cpg_fetch_icon('cancel', 0);
    $social_bookmarks_icon_array['stop'] = cpg_fetch_icon('stop', 0);
    $return['language'] = $lang_plugin_social_bookmarks;
    $return['icon'] = $social_bookmarks_icon_array;
    return $return;
}
Beispiel #2
0
function monitor_calibration_bar_language()
{
    global $CONFIG, $lang_plugin_moncalb, $moncal_icon_array;
    require "./plugins/monitorcalibrationbar/lang/english.php";
    if ($CONFIG['lang'] != 'english' && file_exists("./plugins/monitorcalibrationbar/lang/{$CONFIG['lang']}.php")) {
        require "./plugins/monitorcalibrationbar/lang/{$CONFIG['lang']}.php";
    }
    if ($CONFIG['enable_menu_icons'] == 1) {
        $moncal_icon_array['calibration'] = '<img src="./plugins/monitorcalibrationbar/images/icons/calibration.png" width="16" height="16" border="0" alt="" class="icon" />';
        $moncal_icon_array['config'] = '<img src="./plugins/monitorcalibrationbar/images/icons/calibration_config.png" width="16" height="16" border="0" alt="" class="icon" />';
    } else {
        $moncal_icon_array['calibration'] = '';
        $moncal_icon_array['config'] = '';
    }
    if ($CONFIG['enable_menu_icons'] >= 1) {
        $moncal_icon_array['config_menu'] = '<img src="./plugins/monitorcalibrationbar/images/icons/calibration_config.png" width="16" height="16" border="0" alt="" class="icon" />';
    } else {
        $moncal_icon_array['config_menu'] = '';
    }
    $moncal_icon_array['announcement'] = cpg_fetch_icon('announcement', 1);
    $moncal_icon_array['plugin_manager'] = cpg_fetch_icon('plugin_mgr', 2);
    $moncal_icon_array['ok'] = cpg_fetch_icon('ok', 1);
    $return['language'] = $lang_plugin_moncalb;
    $return['icon'] = $moncal_icon_array;
    return $return;
}
Beispiel #3
0
function favorite_mailer_button()
{
    $superCage = Inspekt::makeSuperCage();
    if ($superCage->get->getAlpha('album') == 'favpics') {
        global $lang_meta_album_names;
        $lang_meta_album_names['favpics'] .= ' <a href="contact.php?fm_mail" title="Send favorites to admin">' . cpg_fetch_icon('contact', 2) . '</a>';
    }
}
Beispiel #4
0
function FileMove_page_start()
{
    global $CONFIG, $lang_plugin_FileMove;
    require './plugins/FileMove/include/init.inc.php';
    $icon = cpg_fetch_icon('download', 1);
    if (GALLERY_ADMIN_MODE) {
        FileMove_config_button('index.php?file=FileMove/plugin_config', $lang_plugin_FileMove['config_title'], '', $lang_plugin_FileMove['config_button']);
    }
}
Beispiel #5
0
function check_files_admin_menu($admin_menu)
{
    if (GALLERY_ADMIN_MODE) {
        $new_button = "\n            <div class=\"admin_menu admin_float\"><a href=\"index.php?file=check_files/additional_files&amp;do=dashboard\">" . cpg_fetch_icon('disk_usage', 2) . "Search for additional files</a></div>\n            <div class=\"admin_menu admin_float\"><a href=\"index.php?file=check_files/missing_files&amp;do=dashboard\">" . cpg_fetch_icon('disk_usage', 2) . "Search for missing files</a></div>\n        ";
        $look_for = "<!-- END documentation -->";
        $admin_menu = str_replace($look_for, $look_for . $new_button, $admin_menu);
    }
    return $admin_menu;
}
Beispiel #6
0
function newsletter_initialize()
{
    global $CONFIG, $JS, $lang_plugin_newsletter, $newsletter_icon_array;
    $superCage = Inspekt::makeSuperCage();
    if (in_array('js/jquery.spinbutton.js', $JS['includes']) != TRUE) {
        $JS['includes'][] = 'js/jquery.spinbutton.js';
    }
    if (in_array('plugins/newsletter/js/script.js', $JS['includes']) != TRUE) {
        $JS['includes'][] = 'plugins/newsletter/js/script.js';
    }
    require "./plugins/newsletter/lang/english.php";
    if ($CONFIG['lang'] != 'english' && file_exists("./plugins/newsletter/lang/{$CONFIG['lang']}.php")) {
        require "./plugins/newsletter/lang/{$CONFIG['lang']}.php";
    }
    if ($CONFIG['enable_menu_icons'] == 2) {
        $newsletter_icon_array['config'] = '<img src="./plugins/newsletter/images/icons/config.png" width="16" height="16" border="0" alt="" class="icon" />';
        $newsletter_icon_array['newsletter'] = '<img src="./plugins/newsletter/images/icons/newsletter.png" width="16" height="16" border="0" alt="" class="icon" />';
        $newsletter_icon_array['catlist'] = '<img src="./plugins/newsletter/images/icons/catlist.png" width="16" height="16" border="0" alt="" class="icon" />';
        $newsletter_icon_array['subscribe'] = '<img src="./plugins/newsletter/images/icons/subscribe.png" width="16" height="16" border="0" alt="" class="icon" />';
        $newsletter_icon_array['mailing'] = '<img src="./plugins/newsletter/images/icons/mailing.png" width="16" height="16" border="0" alt="" class="icon" />';
        $newsletter_icon_array['archive'] = '<img src="./plugins/newsletter/images/icons/archive.png" width="16" height="16" border="0" alt="" class="icon" />';
        $newsletter_icon_array['locked'] = '<img src="./plugins/newsletter/images/icons/locked.png" width="16" height="16" border="0" alt="" class="icon" />';
        $newsletter_icon_array['unlocked'] = '<img src="./plugins/newsletter/images/icons/unlocked.png" width="16" height="16" border="0" alt="" class="icon" />';
        $newsletter_icon_array['search'] = '<img src="./plugins/newsletter/images/icons/search.png" width="16" height="16" border="0" alt="" class="icon" />';
        $newsletter_icon_array['send'] = '<img src="./plugins/newsletter/images/icons/send.png" width="16" height="16" border="0" alt="" class="icon" />';
        $newsletter_icon_array['queue'] = '<img src="./plugins/newsletter/images/icons/delete.png" width="16" height="16" border="0" alt="" class="icon" />';
    } else {
        $newsletter_icon_array['config'] = '';
        $newsletter_icon_array['announcement'] = '';
        $newsletter_icon_array['catlist'] = '';
        $newsletter_icon_array['subscribe'] = '';
        $newsletter_icon_array['mailing'] = '';
        $newsletter_icon_array['archive'] = '';
        $newsletter_icon_array['locked'] = '<img src="./plugins/newsletter/images/icons/locked.png" width="16" height="16" border="0" alt="" class="icon" />';
        $newsletter_icon_array['unlocked'] = '<img src="./plugins/newsletter/images/icons/unlocked.png" width="16" height="16" border="0" alt="" class="icon" />';
        $newsletter_icon_array['search'] = '';
        $newsletter_icon_array['send'] = '';
        $newsletter_icon_array['queue'] = '';
    }
    $newsletter_icon_array['announcement'] = cpg_fetch_icon('announcement', 1);
    $newsletter_icon_array['plugin_manager'] = cpg_fetch_icon('plugin_mgr', 2);
    $newsletter_icon_array['ok'] = cpg_fetch_icon('ok', 2);
    $newsletter_icon_array['success'] = cpg_fetch_icon('ok', 0);
    $newsletter_icon_array['failure'] = cpg_fetch_icon('cancel', 0);
    $newsletter_icon_array['cancel'] = cpg_fetch_icon('cancel', 2);
    $newsletter_icon_array['edit'] = cpg_fetch_icon('edit', 0);
    $newsletter_icon_array['delete'] = cpg_fetch_icon('delete', 0);
    $newsletter_icon_array['add'] = cpg_fetch_icon('add', 2);
    $newsletter_icon_array['visible'] = cpg_fetch_icon('online', 0);
    $newsletter_icon_array['invisible'] = cpg_fetch_icon('offline', 0);
    $return['language'] = $lang_plugin_newsletter;
    $return['icon'] = $newsletter_icon_array;
    return $return;
}
Beispiel #7
0
function fte_init()
{
    global $CONFIG, $lang_plugin_filetypes_editor, $filetypes_editor_icon_array;
    require "./plugins/filetypes_editor/lang/english.php";
    if ($CONFIG['lang'] != 'english' && file_exists("./plugins/filetypes_editor/lang/{$CONFIG['lang']}.php")) {
        require "./plugins/filetypes_editor/lang/{$CONFIG['lang']}.php";
    }
    if ($CONFIG['enable_menu_icons'] == 2) {
        $filetypes_editor_icon_array['audio'] = '<img src="./plugins/filetypes_editor/images/icons/audio.png" border="0" width="16" height="16" alt="" class="icon" />';
        $filetypes_editor_icon_array['document'] = '<img src="./plugins/filetypes_editor/images/icons/document.png" border="0" width="16" height="16" alt="" class="icon" />';
        $filetypes_editor_icon_array['image'] = '<img src="./plugins/filetypes_editor/images/icons/image.png" border="0" width="16" height="16" alt="" class="icon" />';
        $filetypes_editor_icon_array['movie'] = '<img src="./plugins/filetypes_editor/images/icons/movie.png" border="0" width="16" height="16" alt="" class="icon" />';
        $filetypes_editor_icon_array['qt'] = '<img src="./plugins/filetypes_editor/images/icons/quicktime.png" border="0" width="16" height="16" alt="" class="icon" />';
        $filetypes_editor_icon_array['rmp'] = '<img src="./plugins/filetypes_editor/images/icons/real.png" border="0" width="16" height="16" alt="" class="icon" />';
        $filetypes_editor_icon_array['swf'] = '<img src="./plugins/filetypes_editor/images/icons/flash.png" border="0" width="16" height="16" alt="" class="icon" />';
        $filetypes_editor_icon_array['wmp'] = '<img src="./plugins/filetypes_editor/images/icons/wmp.png" border="0" width="16" height="16" alt="" class="icon" />';
    } else {
        $filetypes_editor_icon_array['audio'] = '';
        $filetypes_editor_icon_array['document'] = '';
        $filetypes_editor_icon_array['image'] = '';
        $filetypes_editor_icon_array['movie'] = '';
        $filetypes_editor_icon_array['qt'] = '';
        $filetypes_editor_icon_array['rmp'] = '';
        $filetypes_editor_icon_array['swf'] = '';
        $filetypes_editor_icon_array['wmp'] = '';
    }
    if ($CONFIG['enable_menu_icons'] >= 1) {
        $filetypes_editor_icon_array['filetype'] = '<img src="./plugins/filetypes_editor/images/icons/filetype.png" width="16" height="16" border="0" alt="" class="icon" />';
    } else {
        $filetypes_editor_icon_array['filetype'] = '';
    }
    $filetypes_editor_icon_array['announcement'] = cpg_fetch_icon('announcement', 1);
    $filetypes_editor_icon_array['plugin_manager'] = cpg_fetch_icon('plugin_mgr', 2);
    $filetypes_editor_icon_array['edit'] = cpg_fetch_icon('edit', 0);
    $filetypes_editor_icon_array['add'] = cpg_fetch_icon('add', 2);
    $filetypes_editor_icon_array['delete'] = cpg_fetch_icon('delete', 2);
    $filetypes_editor_icon_array['ok'] = cpg_fetch_icon('ok', 2);
    $filetypes_editor_icon_array['cancel'] = cpg_fetch_icon('cancel', 2);
    $filetypes_editor_icon_array['none'] = cpg_fetch_icon('cancel', 2);
    $return['language'] = $lang_plugin_filetypes_editor;
    $return['icon'] = $filetypes_editor_icon_array;
    return $return;
}
Beispiel #8
0
function external_edit_init()
{
    global $CONFIG, $lang_plugin_external_edit, $external_edit_icon_array;
    require "./plugins/external_edit/lang/english.php";
    if ($CONFIG['lang'] != 'english' && file_exists("./plugins/external_edit/lang/{$CONFIG['lang']}.php")) {
        require "./plugins/external_edit/lang/{$CONFIG['lang']}.php";
    }
    if ($CONFIG['enable_menu_icons'] > 0) {
        $external_edit_icon_array['fotoflexer'] = '<img src="./plugins/external_edit/images/icons/fotoflexer.png" width="16" height="16" border="0" alt="" class="icon" />';
    } else {
        $external_edit_icon_array['fotoflexer'] = '';
    }
    $external_edit_icon_array['announcement'] = cpg_fetch_icon('announcement', 1);
    $external_edit_icon_array['ok'] = cpg_fetch_icon('ok', 2);
    $external_edit_icon_array['cancel'] = cpg_fetch_icon('cancel', 2);
    $external_edit_icon_array['none'] = cpg_fetch_icon('cancel', 2);
    $external_edit_icon_array['ignore'] = cpg_fetch_icon('ignore', 2);
    $return['language'] = $lang_plugin_external_edit;
    $return['icon'] = $external_edit_icon_array;
    return $return;
}
Beispiel #9
0
function annotate_initialize()
{
    global $CONFIG, $JS, $lang_plugin_annotate, $annotate_icon_array;
    require_once "./plugins/annotate/lang/english.php";
    if ($CONFIG['lang'] != 'english' && file_exists("./plugins/annotate/lang/{$CONFIG['lang']}.php")) {
        require_once "./plugins/annotate/lang/{$CONFIG['lang']}.php";
    }
    if ($CONFIG['enable_menu_icons'] == 2) {
        $annotate_icon_array['annotate'] = '<img src="./plugins/annotate/images/icons/annotate.png" border="0" width="16" height="16" alt="" class="icon" />';
        $annotate_icon_array['permission_none'] = '<img src="./plugins/annotate/images/icons/invisible.png" border="0" width="16" height="16" alt="" class="icon" />';
        $annotate_icon_array['permission_read'] = '<img src="./plugins/annotate/images/icons/visible.png" border="0" width="16" height="16" alt="" class="icon" />';
        $annotate_icon_array['permission_write'] = '<img src="./plugins/annotate/images/icons/edit.png" border="0" width="16" height="16" alt="" class="icon" />';
        $annotate_icon_array['permission_delete'] = '<img src="./plugins/annotate/images/icons/delete.png" border="0" width="16" height="16" alt="" class="icon" />';
        $annotate_icon_array['announcement'] = cpg_fetch_icon('announcement', 1);
        $annotate_icon_array['configure'] = cpg_fetch_icon('config', 1);
        $annotate_icon_array['update_database'] = cpg_fetch_icon('update_database', 1);
        $annotate_icon_array['import'] = cpg_fetch_icon('download', 1);
        $annotate_icon_array['manage'] = cpg_fetch_icon('edit', 1);
        $annotate_icon_array['ok'] = cpg_fetch_icon('ok', 2);
        $annotate_icon_array['cancel'] = cpg_fetch_icon('cancel', 2);
        $annotate_icon_array['delete'] = cpg_fetch_icon('delete', 2);
    } else {
        $annotate_icon_array['annotate'] = '';
        $annotate_icon_array['permission_none'] = '';
        $annotate_icon_array['permission_read'] = '';
        $annotate_icon_array['permission_write'] = '';
        $annotate_icon_array['permission_delete'] = '';
        $annotate_icon_array['announcement'] = '';
        $annotate_icon_array['configure'] = '';
        $annotate_icon_array['update_database'] = '';
        $annotate_icon_array['import'] = '';
        $annotate_icon_array['manage'] = '';
        $annotate_icon_array['ok'] = '';
        $annotate_icon_array['cancel'] = '';
        $annotate_icon_array['delete'] = '';
    }
    $return['language'] = $lang_plugin_annotate;
    $return['icon'] = $annotate_icon_array;
    return $return;
}
Beispiel #10
0
function mirror_configure()
{
    global $CONFIG, $CPG_PLUGINS;
    $icon_array['ok'] = cpg_fetch_icon('ok', 1);
    $icon_array['cancel'] = cpg_fetch_icon('cancel', 1);
    $allow_continue = 1;
    echo <<<EOT
    <form action="" method="post" name="mirror_config" id="mirror_config">
        <ul>
EOT;
    if ($CONFIG['transparent_overlay'] != '0') {
        echo <<<EOT
            <li>The mirror plugin doesn't work with the config option '<em>Insert a transparent overlay to minimize image theft</em>'. If you decide to continue, that option will be disabled for you. Don't turn it back on while using this plugin.</li>
EOT;
    }
    if (($plugin_id = CPGPluginAPI::installed('image_manipulation')) !== false) {
        echo <<<EOT
            <li>You have installed the plugin '<em>Image Manipulation (image_manipulation)</em>' that can't be run at the same time with the Mirror plugin. Return to the plugin manager and uninstall that other plugin first before installing this plugin.</li>
EOT;
        $allow_continue = 0;
    }
    echo <<<EOT
        </ul>
EOT;
    if ($allow_continue == 1) {
        echo <<<EOT
        <input type="hidden" name="mirror_continue_anyway" id="mirror_continue_anyway" value="1" />
        <button type="submit" class="button" name="submit" value="Continue anyway">{$icon_array['ok']}Continue anyway</button>
EOT;
    }
    echo <<<EOT
        <a href="pluginmgr.php" class="admin_menu">{$icon_array['cancel']}Cancel</a>
EOT;
    echo <<<EOT
    </form>
EOT;
}
Beispiel #11
0
function thumb_rotate_initialize()
{
    global $CONFIG, $lang_plugin_thumb_rotate, $thumb_rotate_icon_array, $gd_extension_array;
    $superCage = Inspekt::makeSuperCage();
    $gd_extension_array = array('jpg', 'jpeg', 'gif', 'png');
    if (GALLERY_ADMIN_MODE) {
        global $JS;
        $JS['includes'][] = 'plugins/thumb_rotate/js/farbtastic.js';
        $JS['includes'][] = 'js/jquery.spinbutton.js';
    }
    require "./plugins/thumb_rotate/lang/english.php";
    if ($CONFIG['lang'] != 'english' && file_exists("./plugins/thumb_rotate/lang/{$CONFIG['lang']}.php")) {
        require "./plugins/thumb_rotate/lang/{$CONFIG['lang']}.php";
    }
    if ($CONFIG['enable_menu_icons'] == 2) {
        $thumb_rotate_icon_array['thumb_rotate'] = '<img src="./plugins/thumb_rotate/images/icons/thumb_rotate.png" width="16" height="16" border="0" alt="" class="icon" />';
        $thumb_rotate_icon_array['config'] = '<img src="./plugins/thumb_rotate/images/icons/config.png" width="16" height="16" border="0" alt="" class="icon" />';
        $thumb_rotate_icon_array['batch'] = '<img src="./plugins/thumb_rotate/images/icons/batch.png" width="16" height="16" border="0" alt="" class="icon" />';
    } else {
        $thumb_rotate_icon_array['thumb_rotate'] = '';
        $thumb_rotate_icon_array['config'] = '';
        $thumb_rotate_icon_array['batch'] = '';
    }
    if ($CONFIG['enable_menu_icons'] >= 1) {
        $thumb_rotate_icon_array['config_menu'] = '<img src="./plugins/thumb_rotate/images/icons/thumb_rotate_config.png" width="16" height="16" border="0" alt="" class="icon" />';
    } else {
        $thumb_rotate_icon_array['config_menu'] = '';
    }
    $thumb_rotate_icon_array['announcement'] = cpg_fetch_icon('announcement', 1);
    $thumb_rotate_icon_array['plugin_manager'] = cpg_fetch_icon('plugin_mgr', 2);
    $thumb_rotate_icon_array['ok'] = cpg_fetch_icon('ok', 2);
    $thumb_rotate_icon_array['cancel'] = cpg_fetch_icon('cancel', 2);
    $thumb_rotate_icon_array['next'] = cpg_fetch_icon('right', 2);
    $return['language'] = $lang_plugin_thumb_rotate;
    $return['icon'] = $thumb_rotate_icon_array;
    return $return;
}
     $results = cpg_db_query("SELECT value FROM {$CONFIG['TABLE_BRIDGE']} WHERE name = 'recovery_logon_timestamp'");
     if ($results->numRows()) {
         $row = $results->fetchArray(true);
     }
     $recovery_logon_timestamp = $row['value'];
     //print $recovery_logon_timestamp;
     $results = cpg_db_query("SELECT value FROM {$CONFIG['TABLE_BRIDGE']} WHERE name = 'recovery_logon_failures'");
     if ($results->numRows()) {
         $row = $results->fetchArray(true);
     }
     $recovery_logon_failures = $row['value'];
     $logon_allowed = cpg_check_allowed_emergency_logon($recovery_logon_timestamp, $recovery_logon_failures);
     if ($logon_allowed < 0) {
         $logon_allowed = 0;
     }
     starttable(-1, cpg_fetch_icon('bridge_mgr', 2) . $lang_bridgemgr_php['recovery_title'], 2);
     echo <<<EOT
 <form name="disable_integration" id="cpgform" action="{$CPG_PHP_SELF}" method="post">
 <tr>
     <td class="tableb" colspan="2">
         {$lang_bridgemgr_php['recovery_explanation']}
     </td>
 </tr>
 <tr>
       <td class="tableb" width="40%">{$lang_bridgemgr_php['username']}</td>
       <td class="tableb" width="60%"><input type="text" class="textinput" name="username" style="width: 100%" /></td>
 </tr>
 <tr>
     <td class="tableb">{$lang_bridgemgr_php['password']}</td>
     <td class="tableb"><input type="password" class="textinput" name="password" style="width: 100%" /></td>
 </tr>
function edit_user($user_id)
{
    global $CONFIG, $CPG_PHP_SELF, $LINEBREAK;
    //, $PHP_SELF;
    global $lang_usermgr_php, $lang_common, $icon_array, $op;
    $form_data = array(array('input', 'user_name', cpg_fetch_icon('my_profile', 2) . $lang_usermgr_php['name'], 25), array('password', 'user_password', cpg_fetch_icon('key_enter', 2) . $lang_usermgr_php['password'], 25), array('yesno', 'user_active', cpg_fetch_icon('online', 2) . $lang_usermgr_php['user_active']), array('group_list', 'user_group', cpg_fetch_icon('groups_mgr', 2) . $lang_usermgr_php['user_group']), array('input', 'user_email', cpg_fetch_icon('mail', 2) . $lang_usermgr_php['user_email'], 255));
    if ($CONFIG['user_profile1_name'] != '') {
        $form_data[] = array('input', 'user_profile1', cpg_fetch_icon('blank', 2) . $CONFIG['user_profile1_name'], 255);
    }
    if ($CONFIG['user_profile2_name'] != '') {
        $form_data[] = array('input', 'user_profile2', cpg_fetch_icon('blank', 2) . $CONFIG['user_profile2_name'], 255);
    }
    if ($CONFIG['user_profile3_name'] != '') {
        $form_data[] = array('input', 'user_profile3', cpg_fetch_icon('blank', 2) . $CONFIG['user_profile3_name'], 255);
    }
    if ($CONFIG['user_profile4_name'] != '') {
        $form_data[] = array('input', 'user_profile4', cpg_fetch_icon('blank', 2) . $CONFIG['user_profile4_name'], 255);
    }
    if ($CONFIG['user_profile5_name'] != '') {
        $form_data[] = array('input', 'user_profile5', cpg_fetch_icon('blank', 2) . $CONFIG['user_profile5_name'], 255);
    }
    if ($CONFIG['user_profile6_name'] != '') {
        $form_data[] = array('textarea', 'user_profile6', cpg_fetch_icon('blank', 2) . $CONFIG['user_profile6_name'], 255);
    }
    //$form_data = CPGPluginAPI::filter('usermgr_form_list', array(0 => $form_data, 1 => $user_id);
    list($timestamp, $form_token) = getFormToken();
    if ($user_id != 'new_user') {
        $sql = "SELECT * FROM {$CONFIG['TABLE_USERS']} WHERE user_id = '{$user_id}'";
        $result = cpg_db_query($sql);
        if (!mysql_num_rows($result)) {
            cpg_die(CRITICAL_ERROR, $lang_usermgr_php['err_unknown_user'], __FILE__, __LINE__);
        }
        $user_data = mysql_fetch_array($result);
        mysql_free_result($result);
        if (mysql_num_rows(cpg_db_query("SELECT user_name FROM {$CONFIG['TABLE_BANNED']} WHERE user_name = '" . addslashes($user_data['user_name']) . "' AND brute_force=0 LIMIT 1"))) {
            $user_status = $lang_usermgr_php['user_is_banned'];
        } elseif ($user_data['user_active'] == 'YES') {
            $user_status = $lang_usermgr_php['status_active'];
        } else {
            $user_status = $lang_usermgr_php['status_inactive'];
        }
    } else {
        // If this is a new user then add a checkbox for 'send login data to user' option
        $form_data[] = array('checkbox', 'send_login_data', $lang_usermgr_php['send_login_data']);
        $user_data = array('user_name' => '', 'user_active' => '', 'user_group' => '', 'user_group_list' => '', 'user_email' => '', 'user_profile1' => '', 'user_profile2' => '', 'user_profile3' => '', 'user_profile4' => '', 'user_profile6' => '');
    }
    $status_icon = cpg_fetch_icon('online', 2);
    echo <<<EOT
        <form name="cpgform3" id="cpgform3" method="post" action="{$CPG_PHP_SELF}?op=update&amp;user_id={$user_id}">

EOT;
    if ($op == 'new_user') {
        starttable(500, $icon_array['add_user'] . $lang_usermgr_php['create_new_user'], 2);
    } else {
        starttable(500, $icon_array['edit'] . $lang_usermgr_php['modify_user'], 2);
        echo <<<EOT
        <tr>
                <td class="tableb">
                        {$status_icon}{$lang_usermgr_php['status']}
                </td>
                <td class="tableb">
                        {$user_status}
                </td>
        </tr>
EOT;
    }
    $loopCounter = 0;
    foreach ($form_data as $element) {
        if ($loopCounter / 2 == floor($loopCounter / 2)) {
            $row_style_class = 'tableb tableb_alternate';
        } else {
            $row_style_class = 'tableb';
        }
        $loopCounter++;
        switch ($element[0]) {
            case 'input':
                $value = $user_data[$element[1]];
                if ($element[2]) {
                    echo <<<EOT
            <tr>
                <td width="40%" class="{$row_style_class}" valign="top">
                            {$element[2]}
            </td>
            <td width="60%" class="{$row_style_class}" valign="top">
                    <input type="text" style="width: 100%" name="{$element[1]}" maxlength="{$element[3]}" value="{$value}" class="textinput" />
                    </td>
            </tr>


EOT;
                }
                break;
            case 'textarea':
                $value = $user_data[$element[1]];
                if ($element[2]) {
                    echo <<<EOT
            <tr>
                <td width="40%" class="{$row_style_class}" height="25" valign="top">
                            {$element[2]}
            </td>
            <td width="60%" class="{$row_style_class}" valign="top">
                    <textarea name="{$element[1]}" rows="7" cols="40" class="textinput" style="width: 100%">{$value}</textarea>
                    </td>
            </tr>


EOT;
                }
                break;
            case 'password':
                echo <<<EOT
            <tr>
                <td width="40%" class="{$row_style_class}" valign="top">
                            {$element[2]}
            </td>
            <td width="60%" class="{$row_style_class}" valign="top">
                    <input type="password" style="width: 100%" name="{$element[1]}" maxlength="{$element[3]}" value="" class="textinput" />
                    </td>
            </tr>

EOT;
                break;
            case 'yesno':
                $value = $user_data[$element[1]];
                $yes_selected = $value == 'YES' || $op == 'new_user' ? 'checked="checked"' : '';
                $no_selected = $value == 'NO' ? 'checked="checked"' : '';
                echo <<<EOT
            <tr>
                <td class="{$row_style_class}" valign="top">
                            {$element[2]}
            </td>
                    <td class="{$row_style_class}" valign="top">
                        <input type="radio" id="yes" name="{$element[1]}" value="YES" {$yes_selected} /><label for="yes" class="clickable_option">{$lang_common['yes']}</label>
                        &nbsp;&nbsp;
                        <input type="radio" id="no" name="{$element[1]}" value="NO" {$no_selected} /><label for="no" class="clickable_option">{$lang_common['no']}</label>
                    </td>
            </tr>

EOT;
                break;
            case 'group_list':
                $sql = "SELECT group_id, group_name FROM {$CONFIG['TABLE_USERGROUPS']} ORDER BY group_name";
                $result = cpg_db_query($sql);
                $group_list = cpg_db_fetch_rowset($result);
                mysql_free_result($result);
                $sel_group = $user_data[$element[1]];
                $user_group_list = $user_data['user_group_list'] == '' ? ',' . $sel_group . ',' : ',' . $user_data['user_group_list'] . ',' . $sel_group . ',';
                echo <<<EOT
            <tr>
                <td class="{$row_style_class}" valign="top">
                            {$element[2]}
            </td>
            <td class="{$row_style_class}" valign="top">
                    <select name="{$element[1]}" class="listbox">

EOT;
                $group_cb = '';
                foreach ($group_list as $group) {
                    echo '                        <option value="' . $group['group_id'] . '"' . ($group['group_id'] == $sel_group || $op == 'new_user' && $group['group_id'] == 2 ? ' selected="selected"' : '') . '>' . $group['group_name'] . '</option>' . $LINEBREAK;
                    if ($group['group_id'] != 3) {
                        $checked = strpos(' ' . $user_group_list, ',' . $group['group_id'] . ',') ? 'checked="checked"' : '';
                        $group_cb .= '<input name="group_list[]" type="checkbox" value="' . $group['group_id'] . '" ' . $checked . ' />' . $group['group_name'] . '<br />' . $LINEBREAK;
                    }
                }
                $assignedGroupsHelp = cpg_display_help('f=users.htm&amp;as=user_cp_edit_permission_by_group&amp;ae=user_cp_edit_permission_by_group_end', '450', '300');
                echo <<<EOT
                            </select><br />
                            {$group_cb}
                            <br />
                            <a href="usermgr.php?op=groups_alb_access&amp;form_token={$form_token}&amp;timestamp={$timestamp}" class="admin_menu">{$lang_usermgr_php['groups_alb_access']}</a>
                            {$assignedGroupsHelp}

              </td>
            </tr>

EOT;
                break;
            case 'checkbox':
                echo <<<EOT
            <tr>
                <td class="{$row_style_class}" valign="top">
                            <label for="send_login_data">{$element[2]}</label>
            </td>
                    <td class="{$row_style_class} valign="top"">
                        <input type="checkbox" id="send_login_data" name="{$element[1]}" value="YES" />
                    </td>
            </tr>

EOT;
                break;
            default:
                cpg_die(CRITICAL_ERROR, 'Invalid action for form creation ' . $element[0], __FILE__, __LINE__);
        }
    }
    if ($op == 'new_user') {
        echo <<<EOT
        <tr>
                <td colspan="2" align="center" class="tablef">
                        <button type="submit" class="button" name="usermgr_edit_submit" value="{$lang_usermgr_php['submit']}">{$icon_array['ok']}{$lang_usermgr_php['submit']}</button>
                        <input type="hidden" name="form_token" value="{$form_token}" />
                        <input type="hidden" name="timestamp" value="{$timestamp}" />
                </td>
        </tr>

EOT;
    } else {
        echo <<<EOT
        <tr>
                <td colspan="2" class="tableh2">
                        {$lang_usermgr_php['notes']}
                </td>
        </tr>
        <tr>
                <td colspan="2" class="tableb">
                        <ul>
                            <li>{$lang_usermgr_php['note_list']}</li>
                        </ul>
                </td>
        </tr>
        <tr>
                <td colspan="2" align="center" class="tablef">
                        <button type="submit" class="button" name="usermgr_edit_submit" value="{$lang_usermgr_php['modify_user']}">{$icon_array['ok']}{$lang_usermgr_php['modify_user']}</button>
                        <input type="hidden" name="form_token" value="{$form_token}" />
                        <input type="hidden" name="timestamp" value="{$timestamp}" />
                </td>
        </tr>

EOT;
    }
    endtable();
    echo '</form>';
}
Beispiel #14
0
function display_plugin_list()
{
    global $CPG_PLUGINS, $lang_pluginmgr_php, $lang_plugin_php, $lang_common, $CONFIG, $CPG_PHP_SELF;
    list($timestamp, $form_token) = getFormToken();
    $help = '&nbsp;' . cpg_display_help('f=plugins.htm&amp;as=plugin_manager&amp;ae=plugin_manager_end&amp;top=1', '800', '600');
    $help_plugin_enable = cpg_display_help('f=configuration.htm&amp;as=admin_general_enable-plugins&amp;ae=admin_general_enable-plugins_end', 400, 300);
    // configure plugin api (enabled or disabled)
    $yes_selected = $CONFIG['enable_plugins'] ? 'checked="checked"' : '';
    $no_selected = !$CONFIG['enable_plugins'] ? 'checked="checked"' : '';
    print '<form name="pluginenableconfig" id="cpgform2" action="' . $CPG_PHP_SELF . '" method="post" style="margin:0px;padding:0px">';
    starttable('-1', cpg_fetch_icon('plugin_mgr', 2) . $lang_pluginmgr_php['pmgr'] . $help, 3);
    echo <<<EOT
        <tr>
                <td class="tableh2" colspan="3">
                    {$lang_pluginmgr_php['explanation']}
                </td>
        </tr>
        <tr>
                <td class="tableb">
                    {$lang_pluginmgr_php['plugin_enabled']}
                </td>
                <td class="tableb">
                    <input type="radio" id="enable_plugins1" name="enable_plugins" value="1"  onclick="document.pluginenableconfig.submit();" {$yes_selected} class="radio" /><label for="enable_plugins1" class="clickable_option">{$lang_common['yes']}</label>
                    &nbsp;&nbsp;
                    <input type="radio" id="enable_plugins0" name="enable_plugins" value="0"  onclick="document.pluginenableconfig.submit();" {$no_selected} class="radio" /><label for="enable_plugins0" class="clickable_option">{$lang_common['no']}</label>
                    <input type="hidden" name="update_config" value="1" />
                    <input type="hidden" name="form_token" value="{$form_token}" />
                    <input type="hidden" name="timestamp" value="{$timestamp}" />
                </td>
                <td class="tableb">
                    {$help_plugin_enable}
                </td>
        </tr>
EOT;
    endtable();
    print '</form>';
    echo <<<EOT
        <br />
EOT;
    $help = '&nbsp;' . cpg_display_help('f=plugins.htm&amp;as=plugin_manager_uninstall&amp;ae=plugin_manager_uninstall_end&amp;top=1', '640', '480');
    $available_plugins = cpg_get_dir_list('./plugins/');
    starttable('100%');
    echo <<<EOT
        <tr>
                <td class="tableh1" width="90%"><strong><span class="statlink">{$lang_pluginmgr_php['i_plugins']}</span></strong></td>
                <td colspan="3" class="tableh1" align="center" width="10%"><strong><span class="statlink">{$lang_pluginmgr_php['operation']}</span></strong>{$help}</td>
        </tr>
EOT;
    unset($installed_plugins);
    if ($CONFIG['enable_plugins'] == 1) {
        $loop_counter = 0;
        foreach ($CPG_PLUGINS as $thisplugin) {
            $installed_plugins[$loop_counter] = array('index' => $thisplugin->index, 'plugin_id' => $thisplugin->plugin_id, 'path' => $thisplugin->path, 'priority' => $thisplugin->priority, 'error' => $thisplugin->error);
            $loop_counter++;
        }
    } else {
        // If plugin system is turned off, grab installed plugins from database table
        $query = 'SELECT * FROM ' . $CONFIG['TABLE_PLUGINS'] . ' ORDER BY priority ASC;';
        $result = cpg_db_query($query);
        $loop_counter = 0;
        while ($installed_plugin = mysql_fetch_assoc($result)) {
            $installed_plugins[$loop_counter] = array('index' => $loop_counter, 'plugin_id' => $installed_plugin['plugin_id'], 'path' => $installed_plugin['path'], 'priority' => $installed_plugin['priority'], 'error' => array());
            $loop_counter++;
        }
    }
    $installed_count = 0;
    $loop_counter = 0;
    if (isset($installed_plugins) == TRUE) {
        $plugins_count = count($installed_plugins);
        foreach ($installed_plugins as $thisplugin) {
            $installed_count++;
            unset($extra_info);
            unset($install_info);
            include './plugins/' . $thisplugin['path'] . '/configuration.php';
            $pluginPath = $thisplugin['path'];
            $safename = addslashes(str_replace('&nbsp;', '', $name));
            if (isset($extra_info) == TRUE) {
                $extra = $extra_info;
            } else {
                $extra = '';
            }
            if (sizeof($thisplugin['error']) > 0) {
                $error = $thisplugin['error']['desc'];
                $extra = '<tr><td class="tableb" width="100%" colspan="2">' . '<strong>' . $lang_common['error'] . ':</strong> <span style="color:red;">' . $error . '</span>' . '</td></tr>' . $extra;
            }
            if ($loop_counter == 0) {
                $row_style_class = 'tableb';
            } else {
                $row_style_class = 'tableb tableb_alternate';
            }
            $loop_counter++;
            if ($loop_counter > 1) {
                $loop_counter = 0;
            }
            echo <<<EOT
        <tr>
            <td width="90%" class="{$row_style_class}">
                <a name="{$pluginPath}"></a>
                <table border="0" width="100%" cellspacing="0" cellpadding="0" class="maintable">
                    <tr>
                        <td colspan="2" class="tableh1">{$name} ({$pluginPath}): {$lang_pluginmgr_php['vers']}{$version}</td>
                    </tr>
                    <tr>
                        <td class="tableb" valign="top">{$lang_pluginmgr_php['author']}:</td>
                        <td class="tableb" valign="top">{$author}</td>
                    </tr>
                    <tr>
                        <td class="tableb tableb_alternate" valign="top">{$lang_pluginmgr_php['desc']}</td>
                        <td class="tableb tableb_alternate" valign="top">{$description}</td>
                    </tr>
EOT;
            if ($extra != '') {
                echo <<<EOT
                    <tr>
                        <td class="tableb" width="20%" valign="top">{$lang_pluginmgr_php['extra']}:</td>
                        <td class="tableb" valign="top">{$extra}</td>
                    </tr>
EOT;
            }
            echo <<<EOT
                </table>
            </td>
            <td class="{$row_style_class}" valign="top">
            <table border="0" width="100%" cellspacing="0" cellpadding="0">
            <tr>
EOT;
            if ($thisplugin['index'] > 0 && $plugins_count > 1) {
                $up = cpg_fetch_icon('up', 0);
                echo <<<EOT
            <td width="3%" align="center" valign="middle">
                <a href="pluginmgr.php?op=moveu&amp;p={$thisplugin['plugin_id']}&amp;form_token={$form_token}&amp;timestamp={$timestamp}#{$pluginPath}">{$up}</a>
            </td>
EOT;
            } else {
                echo '<td width="3%"></td>';
            }
            if ($thisplugin['index'] < $plugins_count - 1) {
                $down = cpg_fetch_icon('down', 0);
                echo <<<EOT
            <td width="3%" align="center" valign="middle">
                <a href="pluginmgr.php?op=moved&amp;p={$thisplugin['plugin_id']}&amp;form_token={$form_token}&amp;timestamp={$timestamp}#{$pluginPath}">{$down}</a>
            </td>
EOT;
            } else {
                echo '<td width="3%"></td>';
            }
            $confirm_function = $CONFIG['enable_plugins'] == 1 ? 'confirmUninstall' : 'confirmRemove';
            $delete = cpg_fetch_icon('plugin_uninstall', 0);
            echo <<<EOT
            <td width="3%" align="center" valign="middle">
                <a href="pluginmgr.php?op=uninstall&amp;p={$thisplugin['plugin_id']}&amp;form_token={$form_token}&amp;timestamp={$timestamp}" onclick="return {$confirm_function}('{$safename}')" title="{$lang_pluginmgr_php['uninstall']}">
                    {$delete}
                </a>
            </td>

        </tr>
        </table>
        </td>
        </tr>
EOT;
        }
    }
    if ($installed_count == 0) {
        echo '<tr><td colspan="4" class="tableb" align="center">' . $lang_pluginmgr_php['none_installed'] . '</td></tr>';
    }
    endtable();
    echo '<p>&nbsp;</p>';
    echo '<form name="cpgform" id="cpgform" action="pluginmgr.php?op=upload" method="post" enctype="multipart/form-data">';
    $help_upload = '&nbsp;' . cpg_display_help('f=plugins.htm&amp;as=plugin_manager_upload&amp;ae=plugin_manager_upload_end&amp;top=1', '640', '480');
    $help_install = '&nbsp;' . cpg_display_help('f=plugins.htm&amp;as=plugin_manager_install&amp;ae=plugin_manager_install_end&amp;top=1', '640', '480');
    starttable('100%');
    echo <<<EOT
        <tr>
                <td class="tableh1" width="90%">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td align="left">
                                <strong><span class="statlink">{$lang_pluginmgr_php['n_plugins']}</span></strong>{$help_install}
                            </td>
                            <td align="right">
                                    <input type="file" size="40" name="plugin" class="textinput" />
                                    <input type="hidden" name="form_token" value="{$form_token}" />
                                    <input type="hidden" name="timestamp" value="{$timestamp}" />
                                    <input type="submit" class="button" value="{$lang_pluginmgr_php['upload']}" />
                                    {$help_upload}
                            </td>
                        </tr>
                    </table>
                </td>
                <td colspan="3" class="tableh1" align="center" width="10%"><strong><span class="statlink">{$lang_pluginmgr_php['operation']}</span></strong></td>
        </tr>
EOT;
    $loop_counter = 0;
    // Note: CPGPluginAPI::installed() works even if Plugin API is disabled.
    foreach ($available_plugins as $path) {
        if (($plugin_id = CPGPluginAPI::installed($path)) === false) {
            // If codebase.php and configuration.php don't exist, skip this folder
            if (!(file_exists('./plugins/' . $path . '/codebase.php') && file_exists('./plugins/' . $path . '/configuration.php'))) {
                continue;
            }
            unset($extra_info);
            unset($install_info);
            include './plugins/' . $path . '/configuration.php';
            $pluginPath = $path;
            $safename = addslashes(str_replace('&nbsp;', '', $name));
            if (isset($install_info) == TRUE) {
                $extra = $install_info;
            } else {
                $extra = '';
            }
            if ($loop_counter == 0) {
                $row_style_class = 'tableb';
            } else {
                $row_style_class = 'tableb tableb_alternate';
            }
            $loop_counter++;
            if ($loop_counter > 1) {
                $loop_counter = 0;
            }
            echo <<<EOT
            <tr>
            <td width="90%" class="{$row_style_class}">
                <table border="0" width="100%" cellspacing="0" cellpadding="0" class="maintable">
                    <tr>
                        <td colspan="2" class="tableh1">{$name} ({$pluginPath}): {$lang_pluginmgr_php['vers']}{$version}</td>
                    </tr>
                    <tr>
                        <td class="tableb tableb_alternate" width="20%" valign="top">{$lang_pluginmgr_php['author']}:</td>
                        <td class="tableb tableb_alternate" valign="top">{$author}</td>
                    </tr>
                    <tr>
                        <td class="tableb" valign="top">{$lang_pluginmgr_php['desc']}:</td>
                        <td class="tableb" valign="top">{$description}</td>
                    </tr>
EOT;
            if ($extra != '') {
                echo <<<EOT
                    <tr>
                        <td class="tableb tableb_alternate" width="20%" valign="top">{$lang_pluginmgr_php['install_info']}:</td>
                        <td class="tableb tableb_alternate" valign="top">{$extra}</td>
                    </tr>
EOT;
            }
            // Take care of version requirements
            if (isset($plugin_cpg_version['min']) == TRUE) {
                if (version_compare(COPPERMINE_VERSION, $plugin_cpg_version['min']) >= 0) {
                    $plugin_cpg_version['min_ok'] = '1';
                } else {
                    $plugin_cpg_version['min_ok'] = '-1';
                }
            } else {
                $plugin_cpg_version['min_ok'] = '0';
            }
            if (isset($plugin_cpg_version['max']) == TRUE) {
                if (version_compare(COPPERMINE_VERSION, $plugin_cpg_version['max']) <= 0) {
                    $plugin_cpg_version['max_ok'] = '1';
                } else {
                    $plugin_cpg_version['max_ok'] = '-1';
                }
            } else {
                $plugin_cpg_version['max_ok'] = '0';
            }
            if ($CONFIG['enable_plugins'] == 1) {
                if ($plugin_cpg_version['min_ok'] > 0 && $plugin_cpg_version['max_ok'] >= 0) {
                    $install_button = '<a href="pluginmgr.php?op=install&amp;p=' . $path . '&amp;form_token=' . $form_token . '&amp;timestamp=' . $timestamp . '" title="' . $lang_pluginmgr_php['install'] . '">' . cpg_fetch_icon('plugin_install', 0) . '</a>';
                } elseif ($plugin_cpg_version['min_ok'] < 0 || $plugin_cpg_version['max_ok'] < 0) {
                    if (isset($lang_pluginmgr_php['minimum_requirements_not_met']) != TRUE) {
                        $lang_pluginmgr_php['minimum_requirements_not_met'] = 'Minimum requirements not met';
                    }
                    $install_button = '<span title="' . $lang_pluginmgr_php['minimum_requirements_not_met'] . '">' . cpg_fetch_icon('cancel', 0) . '</span>';
                } else {
                    $install_button = '<a href="pluginmgr.php?op=install&amp;p=' . $path . '&amp;form_token=' . $form_token . '&amp;timestamp=' . $timestamp . '" onclick="return confirmVersionMissing(\'' . $safename . '\')" title="' . $lang_pluginmgr_php['install'] . '" >' . cpg_fetch_icon('plugin_mgr', 0) . '</a>';
                }
            } else {
                $install_button = cpg_fetch_icon('blank', 0);
            }
            unset($plugin_cpg_version);
            $delete = cpg_fetch_icon('delete', 0);
            echo <<<EOT
                </table>
            </td>
            <td class="{$row_style_class}" valign="top">
                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="5%" align="center" valign="top">

                    </td>
                    <td width="5%" align="center" valign="top">
                        {$install_button}
                    </td>
                    <td width="5%" align="center" valign="top">
                        <a href="pluginmgr.php?op=delete&amp;p={$path}&amp;form_token={$form_token}&amp;timestamp={$timestamp}" onclick="return confirmDel('{$safename}')" title="{$lang_common['delete']}">
                            {$delete}
                        </a>
                    </td>
                </tr>
                </table>
            </td>
            </tr>
EOT;
        }
    }
    endtable();
    echo '</form>';
}
Beispiel #15
0
function display_cat_list()
{
    global $CAT_LIST, $CONFIG, $lang_catmgr_php, $lang_common, $CPG_PHP_SELF, $LINEBREAK;
    $CAT_LIST3 = $CAT_LIST;
    $loop_counter = 0;
    list($timestamp, $form_token) = getFormToken();
    $form_token = "&amp;form_token={$form_token}&amp;timestamp={$timestamp}";
    foreach ($CAT_LIST3 as $key => $category) {
        if ($category['cid'] == 0) {
            continue;
        }
        if ($loop_counter == 0) {
            $row_style_class = 'tableb';
        } else {
            $row_style_class = 'tableb tableb_alternate';
        }
        $loop_counter++;
        if ($loop_counter > 1) {
            $loop_counter = 0;
        }
        echo '        <tr>' . $LINEBREAK;
        echo '                <td class="' . $row_style_class . '" width="80%"><strong>' . $category['name'] . '</strong></td>' . $LINEBREAK;
        if ($category['pos'] > 0 && $CONFIG['categories_alpha_sort'] != 1) {
            echo '                <td class="' . $row_style_class . '" width="4%"><a href="' . $CPG_PHP_SELF . '?op=movetop&amp;cid1=' . $category['cid'] . '&amp;pos1=' . $category['pos'] . $form_token . '" class="rounded_menu"><span>' . cpg_fetch_icon('upup', 0, $lang_common['move_top']) . '</span></a></td>' . $LINEBREAK;
            echo '                <td class="' . $row_style_class . '" width="4%"><a href="' . $CPG_PHP_SELF . '?op=move&amp;cid1=' . $category['cid'] . '&amp;pos1=' . ($category['pos'] - 1) . '&amp;cid2=' . $category['prev'] . '&amp;pos2=' . $category['pos'] . $form_token . '" class="rounded_menu"><span>' . cpg_fetch_icon('up', 0, $lang_common['move_up']) . '</span></a></td>' . $LINEBREAK;
        } else {
            echo '                <td class="' . $row_style_class . '" width="4%">' . '&nbsp;' . '</td>' . $LINEBREAK;
            echo '                <td class="' . $row_style_class . '" width="4%">' . '&nbsp;' . '</td>' . $LINEBREAK;
        }
        if ($category['pos'] < $CAT_LIST[$category['parent']]['cat_count'] - 1 && $CONFIG['categories_alpha_sort'] != 1) {
            echo '                <td class="' . $row_style_class . '" width="4%"><a href="' . $CPG_PHP_SELF . '?op=move&amp;cid1=' . $category['cid'] . '&amp;pos1=' . ($category['pos'] + 1) . '&amp;cid2=' . $category['next'] . '&amp;pos2=' . $category['pos'] . $form_token . '" class="rounded_menu"><span>' . cpg_fetch_icon('down', 0, $lang_common['move_down']) . '</span></a></td>' . $LINEBREAK;
            echo '                <td class="' . $row_style_class . '" width="4%"><a href="' . $CPG_PHP_SELF . '?op=movebottom&amp;cid1=' . $category['cid'] . '&amp;pos1=' . $category['pos'] . $form_token . '" class="rounded_menu"><span>' . cpg_fetch_icon('downdown', 0, $lang_common['move_bottom']) . '</span></a></td>' . $LINEBREAK;
        } else {
            echo '                <td class="' . $row_style_class . '" width="4%">' . '&nbsp;' . '</td>' . $LINEBREAK;
            echo '                <td class="' . $row_style_class . '" width="4%">' . '&nbsp;' . '</td>' . $LINEBREAK;
        }
        if ($category['cid'] != 1) {
            echo '                <td class="' . $row_style_class . '" width="4%"><a href="' . $CPG_PHP_SELF . '?op=deletecat&amp;cid=' . $category['cid'] . $form_token . '" onclick="return confirmDel(\'' . addslashes(str_replace('&nbsp;', '', $category['name'])) . '\')" class="rounded_menu"><span>' . cpg_fetch_icon('delete', 0, $lang_common['delete']) . '</span></a></td>' . $LINEBREAK;
        } else {
            echo '                <td class="' . $row_style_class . '" width="4%">' . '&nbsp;' . '</td>' . $LINEBREAK;
        }
        echo '                <td class="' . $row_style_class . '" width="4%">' . '<a href="' . $CPG_PHP_SELF . '?op=editcat&amp;cid=' . $category['cid'] . $form_token . '" class="rounded_menu"><span>' . cpg_fetch_icon('edit', 0, $lang_common['edit']) . '</span></a></td>' . $LINEBREAK;
        echo '                <td class="' . $row_style_class . '" width="4%">' . $LINEBREAK . cat_list_box($category['cid'], $CAT_LIST3[$category['parent']]) . $LINEBREAK . '</td>' . $LINEBREAK;
        echo '        </tr>' . $LINEBREAK;
    }
}
Beispiel #16
0
function theme_main_menu($which)
{
    global $AUTHORIZED, $CONFIG, $album, $actual_cat, $cat, $REFERER, $CPG_PHP_SELF;
    global $lang_main_menu, $template_sys_menu, $template_sub_menu, $lang_gallery_admin_menu;
    static $sys_menu = '', $sub_menu = '';
    if (${$which} != '') {
        return ${$which};
    }
    //Check whether user has permission to upload file to the current album if any
    $upload_allowed = false;
    if (isset($album) && is_numeric($album)) {
        if (GALLERY_ADMIN_MODE) {
            $upload_allowed = true;
        } else {
            if (USER_ID) {
                $query = "SELECT null FROM {$CONFIG['TABLE_ALBUMS']} WHERE category='" . (FIRST_USER_CAT + USER_ID) . "' AND aid = '{$album}'";
                $user_albums = cpg_db_query($query);
                if (mysql_num_rows($user_albums)) {
                    $upload_allowed = true;
                } else {
                    $upload_allowed = false;
                }
            }
            if (!$upload_allowed) {
                $query = "SELECT null FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " AND uploads='YES' AND (visibility = '0' OR visibility IN " . USER_GROUP_SET . ") AND aid = '{$album}'";
                $public_albums = cpg_db_query($query);
                if (mysql_num_rows($public_albums)) {
                    $upload_allowed = true;
                } else {
                    $upload_allowed = false;
                }
            }
        }
    }
    $album_l = isset($album) ? "?album={$album}" : '';
    $album_12 = $upload_allowed ? "?album={$album}" : '';
    $cat_l = isset($actual_cat) ? "?cat={$actual_cat}" : (isset($cat) ? "?cat={$cat}" : '?cat=0');
    $cat_l2 = isset($cat) ? "&amp;cat={$cat}" : '';
    $my_gallery_id = FIRST_USER_CAT + USER_ID;
    if ($which == 'sys_menu') {
        if (USER_ID) {
            // visitor is logged in
            template_extract_block($template_sys_menu, 'login');
            if ($CONFIG['contact_form_registered_enable'] == 0) {
                template_extract_block($template_sys_menu, 'contact');
            }
            if ($CONFIG['display_sidebar_user'] != 2) {
                template_extract_block($template_sys_menu, 'sidebar');
            }
            list($timestamp, $form_token) = getFormToken();
        } else {
            // visitor is not logged in
            if ($CONFIG['contact_form_guest_enable'] == 0) {
                template_extract_block($template_sys_menu, 'contact');
            }
            if ($CONFIG['display_sidebar_guest'] != 2) {
                template_extract_block($template_sys_menu, 'sidebar');
            }
            template_extract_block($template_sys_menu, 'logout');
            template_extract_block($template_sys_menu, 'my_profile');
            $timestamp = $form_token = '';
        }
        if (!USER_IS_ADMIN) {
            template_extract_block($template_sys_menu, 'enter_admin_mode');
            template_extract_block($template_sys_menu, 'leave_admin_mode');
        } else {
            if (GALLERY_ADMIN_MODE) {
                template_extract_block($template_sys_menu, 'enter_admin_mode');
            } else {
                template_extract_block($template_sys_menu, 'leave_admin_mode');
            }
        }
        if (!USER_CAN_CREATE_ALBUMS) {
            template_extract_block($template_sys_menu, 'my_gallery');
        }
        if (USER_CAN_CREATE_ALBUMS) {
            template_extract_block($template_sys_menu, 'my_profile');
        }
        if (!USER_CAN_UPLOAD_PICTURES && !USER_CAN_CREATE_ALBUMS) {
            template_extract_block($template_sys_menu, 'upload_pic');
        }
        if (USER_ID || !$CONFIG['allow_user_registration']) {
            template_extract_block($template_sys_menu, 'register');
        }
        if (!USER_ID || !$CONFIG['allow_memberlist'] || GALLERY_ADMIN_MODE) {
            template_extract_block($template_sys_menu, 'allow_memberlist');
        }
        $param = array('{HOME_TGT}' => $CONFIG['home_target'], '{HOME_ICO}' => cpg_fetch_icon('home', 1), '{HOME_LNK}' => $lang_main_menu['home_lnk'], '{CONTACT_TGT}' => "contact.php?referer={$REFERER}", '{CONTACT_ICO}' => cpg_fetch_icon('contact', 1), '{CONTACT_LNK}' => $lang_main_menu['contact_lnk'], '{MY_GAL_TGT}' => "index.php?cat={$my_gallery_id}", '{MY_GAL_ICO}' => cpg_fetch_icon('my_gallery', 1), '{MY_GAL_LNK}' => $lang_main_menu['my_gal_lnk'], '{MEMBERLIST_TGT}' => "usermgr.php", '{MEMBERLIST_ICO}' => cpg_fetch_icon('memberlist', 1), '{MEMBERLIST_LNK}' => $lang_main_menu['memberlist_lnk'], '{MY_PROF_TGT}' => "profile.php?op=edit_profile", '{MY_PROF_ICO}' => cpg_fetch_icon('my_profile', 1), '{MY_PROF_LNK}' => $lang_main_menu['my_prof_lnk'], '{ADM_MODE_TGT}' => "mode.php?admin_mode=1&amp;referer={$REFERER}", '{ADM_MODE_ICO}' => cpg_fetch_icon('admin_mode_on', 1), '{ADM_MODE_LNK}' => $lang_main_menu['adm_mode_lnk'], '{USR_MODE_TGT}' => "mode.php?admin_mode=0&amp;referer={$REFERER}", '{USR_MODE_ICO}' => cpg_fetch_icon('admin_mode_off', 1), '{USR_MODE_LNK}' => $lang_main_menu['usr_mode_lnk'], '{SIDEBAR_TGT}' => "sidebar.php?action=install", '{SIDEBAR_LNK}' => $lang_main_menu['sidebar_lnk'], '{SIDEBAR_ICO}' => cpg_fetch_icon('sidebar', 1), '{UPL_PIC_TGT}' => "upload.php{$album_12}", '{UPL_PIC_LNK}' => $lang_main_menu['upload_pic_lnk'], '{UPL_PIC_ICO}' => cpg_fetch_icon('upload', 1), '{REGISTER_TGT}' => "register.php", '{REGISTER_LNK}' => $lang_main_menu['register_lnk'], '{REGISTER_ICO}' => cpg_fetch_icon('add_user', 1), '{LOGIN_LNK}' => $lang_main_menu['login_lnk'], '{LOGIN_ICO}' => cpg_fetch_icon('login', 1), '{LOGOUT_TGT}' => "logout.php?form_token={$form_token}&amp;timestamp={$timestamp}&amp;referer={$REFERER}", '{LOGOUT_LNK}' => $lang_main_menu['logout_lnk'] . " [" . stripslashes(USER_NAME) . "]", '{LOGOUT_ICO}' => cpg_fetch_icon('logout', 1), '{UPL_APP_LNK}' => $lang_gallery_admin_menu['upl_app_lnk'], '{UPL_APP_TGT}' => "editpics.php?mode=upload_approval", '{UPL_APP_ICO}' => cpg_fetch_icon('file_approval', 1), '{ALB_LIST_TGT}' => "index.php{$cat_l}", '{ALB_LIST_LNK}' => $lang_main_menu['alb_list_lnk'], '{ALB_LIST_ICO}' => cpg_fetch_icon('alb_mgr', 1), '{CUSTOM_LNK_TGT}' => $CONFIG['custom_lnk_url'], '{CUSTOM_LNK_LNK}' => $CONFIG['custom_lnk_name'], '{CUSTOM_ICO}' => cpg_fetch_icon('online', 1), '{LASTUP_TGT}' => "thumbnails.php?album=lastup{$cat_l2}", '{LASTUP_LNK}' => $lang_main_menu['lastup_lnk'], '{LASTUP_ICO}' => cpg_fetch_icon('last_uploads', 1), '{LASTCOM_TGT}' => "thumbnails.php?album=lastcom{$cat_l2}", '{LASTCOM_LNK}' => $lang_main_menu['lastcom_lnk'], '{LASTCOM_ICO}' => cpg_fetch_icon('comment', 1), '{TOPN_TGT}' => "thumbnails.php?album=topn{$cat_l2}", '{TOPN_LNK}' => $lang_main_menu['topn_lnk'], '{TOPN_ICO}' => cpg_fetch_icon('most_viewed', 1), '{TOPRATED_TGT}' => "thumbnails.php?album=toprated{$cat_l2}", '{TOPRATED_LNK}' => $lang_main_menu['toprated_lnk'], '{TOPRATED_ICO}' => cpg_fetch_icon('top_rated', 1), '{FAV_TGT}' => "thumbnails.php?album=favpics", '{FAV_LNK}' => $lang_main_menu['fav_lnk'], '{FAV_ICO}' => cpg_fetch_icon('favorites', 1), '{BROWSEBYDATE_TGT}' => 'calendar.php', '{BROWSEBYDATE_LNK}' => $lang_main_menu['browse_by_date_lnk'], '{BROWSEBYDATE_ICO}' => cpg_fetch_icon('calendar', 1), '{SEARCH_TGT}' => "search.php", '{SEARCH_LNK}' => $lang_main_menu['search_lnk'], '{SEARCH_ICO}' => cpg_fetch_icon('search', 1), '{UPL_APP_LNK}' => $lang_gallery_admin_menu['upl_app_lnk'], '{UPL_APP_TGT}' => "editpics.php?mode=upload_approval", '{UPL_APP_ICO}' => cpg_fetch_icon('file_approval', 1));
        if ($CPG_PHP_SELF != 'login.php') {
            $param['{LOGIN_TGT}'] = "login.php?referer={$REFERER}";
        } else {
            $param['{LOGIN_TGT}'] = "login.php";
        }
        if (!$CONFIG['custom_lnk_url']) {
            template_extract_block($template_sys_menu, 'custom_link');
        }
        $sys_menu = template_eval($template_sys_menu, $param);
    }
    return ${$which};
}
Beispiel #17
0
/**
 * html_albummenu3()
 *
 * This function draws the links for admin menu of Albums when pics can't be edited
 *
 * @param integer $id ID of the album for which the links are being drawn
 * @return string The evaluated template block with links
 **/
function html_albummenu3($id)
{
    global $lang_album_admin_menu;
    /**
     * This template variable can be defined in theme.php of respective theme.
     * This is done here for simplicity.
     */
    $template_album_admin_no_pic_edit_menu = <<<EOT
        <div class="buttonlist align_right">
                <ul>
                        <li>
                                <a href="delete.php?id={ALBUM_ID}&amp;what=album&amp;form_token={FORM_TOKEN}&amp;timestamp={TIMESTAMP}" onclick="return confirm('{CONFIRM_DELETE}');"><span>{DELETE}</span></a>
                        </li>
                        <li>
                                <a href="modifyalb.php?album={ALBUM_ID}"><span>{MODIFY}</span></a>
                        </li>
                </ul>
        </div>
        <div class="clearer"></div>
EOT;
    static $template = '';
    if ($template == '') {
        list($timestamp, $form_token) = getFormToken();
        $params = array('{CONFIRM_DELETE}' => $lang_album_admin_menu['confirm_delete'], '{DELETE}' => cpg_fetch_icon('delete', 1) . $lang_album_admin_menu['delete'], '{MODIFY}' => cpg_fetch_icon('modifyalb', 1) . $lang_album_admin_menu['modify'], '{FORM_TOKEN}' => $form_token, '{TIMESTAMP}' => $timestamp);
        $template = template_eval($template_album_admin_no_pic_edit_menu, $params);
    }
    $params = array('{ALBUM_ID}' => $id);
    return template_eval($template, $params);
}
Beispiel #18
0
<?php

/**************************************************
  Coppermine 1.5.x Plugin - Cookie consent
  *************************************************
  Copyright (c) 2012 eenemeenemuu
  ********************************************
  $HeadURL$
  $Revision$
  $LastChangedBy$
  $Date$
**************************************************/
if (!defined('IN_COPPERMINE')) {
    die('Not in Coppermine...');
}
require "./plugins/cookie_consent/lang/english.php";
if ($CONFIG['lang'] != 'english' && file_exists("./plugins/cookie_consent/lang/{$CONFIG['lang']}.php")) {
    require "./plugins/cookie_consent/lang/{$CONFIG['lang']}.php";
}
$name = $lang_plugin_cookie_consent['name'];
$description = sprintf($lang_plugin_cookie_consent['description'], '<a href="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:32009L0136:EN:NOT" rel="external" class="external">2009/136/EC</a>');
$author = '<a href="http://forum.coppermine-gallery.net/index.php?action=profile;u=24278" rel="external" class="external">eenemeenemuu</a>';
$version = '1.0';
$plugin_cpg_version = array('min' => '1.5.22');
$extra_info = $install_info = '<a href="http://forum.coppermine-gallery.net/index.php/topic,76197.0.html" rel="external" class="admin_menu">' . cpg_fetch_icon('announcement', 1) . $lang_plugin_cookie_consent['announcement_thread'] . '</a>';
Beispiel #19
0
<?php

/**************************************************
  Coppermine 1.5.x Plugin - thumbnail_class
  *************************************************
  Copyright (c) 2011 eenemeenemuu
  *************************************************
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 3 of the License, or
  (at your option) any later version.
  ********************************************
  $HeadURL$
  $Revision$
  $LastChangedBy$
  $Date$
  **************************************************/
$name = 'Thumbnail Class';
$description = 'Adds a new CSS class "thumb" to all thumbnails';
$author = '<a href="http://forum.coppermine-gallery.net/index.php?action=profile;u=24278" rel="external" class="external">eenemeenemuu</a>';
$version = '0.1';
$plugin_cpg_version = array('min' => '1.5');
$extra_info = $install_info = '<a href="http://forum.coppermine-gallery.net/index.php/topic,TODO.0.html" rel="external" class="admin_menu">' . cpg_fetch_icon('announcement', 1) . 'Announcement thread</a>';
          {$userMessage}
        </td>
    </tr>
EOT;
    endtable();
    $admin_page .= ob_get_contents();
    ob_end_clean();
    $admin_page .= '<br />' . $LINEBREAK;
}
$signature = 'Coppermine Photo Gallery ' . COPPERMINE_VERSION . ' (' . COPPERMINE_VERSION_STATUS . ')';
$tabindexCounter = 1;
$numberOfConfigFields = count($CONFIG);
$javascriptOutput = '';
$admin_page .= '<form action="' . $CPG_PHP_SELF . '" method="post" name="cpgform" id="cpgform" onsubmit="return deleteUnneededFields();">';
ob_start();
starttable('100%', cpg_fetch_icon('config', 2) . $lang_admin_php['title'] . ' - ' . $signature, 2);
$admin_page .= ob_get_contents();
ob_end_clean();
if ($superCage->get->keyExists('restore')) {
    $admin_page .= <<<EOT
    <tr>
        <td class="tableb">
\t\t\t<div class="cpg_message_validation">
\t\t\t\t{$lang_admin_php['restore_cfg_confirm']}
\t\t\t</div>
        </td>
        <td class="tableb">
\t\t\t<input type="checkbox" name="really_restore" id="really_restore" value="1" class="checkbox" /><label for="really_restore" class="cliackable_option">{$lang_common['yes']}
        </td>
    </tr>
\t<tr>
    $displayOption_array['no_modification_check'] = 1;
    $optionDisplayOutput_array['no_modification_check'] = 'checked="checked"';
} else {
    $displayOption_array['no_modification_check'] = 0;
}
// Sanitize the GET vars and populate the optionsArray --- end
// Connect to the repository
if ($displayOption_array['output'] != 'options') {
    $file_data_array = cpgVersioncheckConnectRepository();
    $file_data_array = cpg_versioncheckPopulateArray($file_data_array);
    $file_data_count = count($file_data_array);
}
// main code starts here
$title_help = ' ' . cpg_display_help('f=upgrading.htm&amp;as=versioncheck&amp;ae=versioncheck_end', '600', '400');
pageheader($lang_versioncheck_php['title']);
starttable('100%', cpg_fetch_icon('check_versions', 2) . $lang_versioncheck_php['title'] . $title_help, 1);
//print '<h1>' . cpg_fetch_icon('check_versions', 2) . $lang_versioncheck_php['title']. $title_help . '</h1>';
// Print options if applicable
if ($displayOption_array['output'] == 'options' || $displayOption_array['output'] == 'screen' || $displayOption_array['output'] == 'textarea') {
    print <<<EOT
    <tr>
        <td class="tableb">
EOT;
    cpg_versioncheckDisplayOptions();
    print <<<EOT
        </td>
    </tr>
EOT;
}
if ($displayOption_array['output'] == 'create') {
    // create data
Beispiel #22
0
<?php

/**************************************************
  Coppermine 1.5.x Plugin - jquery_update
  *************************************************
  Copyright (c) 2014 eenemeenemuu
  *************************************************
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 3 of the License, or
  (at your option) any later version.
  ********************************************
  $HeadURL$
  $Revision$
  $LastChangedBy$
  $Date$
  **************************************************/
$name = 'jQuery update';
$description = 'Use more recent jQuery versions';
$author = '<a href="http://forum.coppermine-gallery.net/index.php?action=profile;u=24278" rel="external" class="external">eenemeenemuu</a>';
$version = '0.1';
$plugin_cpg_version = array('min' => '1.5');
$announcement_icon = cpg_fetch_icon('announcement', 1);
$extra_info = $install_info = <<<EOT
    <a href="http://forum.coppermine-gallery.net/index.php/topic,77595.0.html" rel="external" class="admin_menu">{$announcement_icon}Announcement thread</a>
EOT
;
    }
}
if (is_array($foldername)) {
    natcasesort($foldername);
    foreach ($foldername as $key) {
        if ($key != '.' && $key != '..') {
            echo '<tr>' . $newline;
            echo '<td class="tableb">' . $newline;
            if ($radio != 0) {
                echo '<input type="radio" name="cf1" value="' . $folder . rtrim($key, $folder_sep) . '/" class="radio" onclick="document.childform.cf2.value=\'' . $folder . $key . '\'" />' . $newline;
            }
            echo '</td>' . $newline;
            echo '<td class="tableb">' . $newline;
            // echo '<a href="'.$CPG_PHP_SELF.'?folder='.rawurlencode($folder_sep.ltrim($folder, $folder_sep).$key.$folder_sep).'&amp;parentform='.rawurlencode($parentform).'&amp;formelementname='.rawurlencode($formelementname).'&amp;no_popup='.$no_popup.'&amp;limitfolder='.$limitfolder.'&amp;linktarget='.$linktarget.'">' . $newline;
            echo '<a href="' . $CPG_PHP_SELF . '?folder=' . rawurlencode($folder_prefix . ltrim($folder, $folder_sep) . $key . $folder_sep) . '&amp;parentform=' . rawurlencode($parentform) . '&amp;formelementname=' . rawurlencode($formelementname) . '&amp;no_popup=' . $no_popup . '&amp;limitfolder=' . $limitfolder . '&amp;linktarget=' . $linktarget . '">' . $newline;
            echo cpg_fetch_icon('folder', 0, $lang_minibrowser_php['folder']) . $newline;
            echo $key . $newline;
            echo '</a>' . $newline;
            echo '</td>' . $newline;
            echo '</tr>' . $newline;
        }
    }
}
if (is_array($filename)) {
    natcasesort($filename);
    foreach ($filename as $key) {
        echo '<tr>' . $newline;
        echo '<td class="tableb">' . $newline;
        echo '&nbsp;';
        echo '</td>' . $newline;
        echo '<td class="tableb">' . $newline;
Beispiel #24
0
}
if ($CONFIG['reg_requires_valid_email'] == 1) {
    $send_activation_link = '<br /><a href="send_activation.php" class="topmenu">' . $lang_login_php['send_activation_link'] . '</a>';
} else {
    $send_activation_link = '';
}
pageheader($lang_login_php['login']);
if ($superCage->get->getInt('force_login')) {
    msg_box($lang_login_php['force_login_title'], $lang_login_php['force_login']);
}
//$referer = urlencode($referer);
$username_icon = cpg_fetch_icon('my_profile', 2);
$password_icon = cpg_fetch_icon('key_enter', 2);
$ok_icon = cpg_fetch_icon('ok', 2);
echo '<form action="login.php?referer=' . urlencode($CPG_REFERER) . '" method="post" name="loginbox" id="cpgform">';
starttable(-1, cpg_fetch_icon('login', 2) . $lang_login_php['enter_login_pswd'], 2);
//see how users are allowed to login, can be username, email address or both
$login_method = $lang_login_php[$CONFIG['login_method']];
echo <<<EOT
                  {$login_failed}
                  {$cookie_warning}
                  <tr>
                      <td class="tableb" width="40%">{$username_icon}{$login_method}</td>
                      <td class="tableb" width="60%"><input type="text" class="textinput" name="username" style="width: 100%" tabindex="1" /></td>
                  </tr>
                  <tr>
                      <td class="tableb">{$password_icon}{$lang_login_php['password']}</td>
                      <td class="tableb"><input type="password" class="textinput" name="password" style="width: 100%" tabindex="2" /></td>
                  </tr>
                  <tr>
                      <td colspan="2" align="center" class="tableb"><label for="remember_me">{$lang_login_php['remember_me']} </label><input name="remember_me" id="remember_me" type="checkbox" class="checkbox" value="1" tabindex="3" /></td>
Beispiel #25
0
<?php

/**************************************************
  Coppermine 1.5.x Plugin - absolute_url
  *************************************************
  Copyright (c) 2010 eenemeenemuu
  *************************************************
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 3 of the License, or
  (at your option) any later version.
  ********************************************
  $HeadURL$
  $Revision$
  $LastChangedBy$
  $Date$
  **************************************************/
$name = 'Absolute picture urls';
$description = 'Creates absolute picture urls by adding your domain name to the relative paths.';
$author = '<a href="http://forum.coppermine-gallery.net/index.php?action=profile;u=24278" rel="external" class="external">eenemeenemuu</a>';
$version = '2.0';
$plugin_cpg_version = array('min' => '1.5');
$announcement_icon = cpg_fetch_icon('announcement', 1);
$config_icon = cpg_fetch_icon('config', 1);
$install_info = <<<EOT
    <a href="http://forum.coppermine-gallery.net/index.php/topic,67980.0.html" rel="external" class="admin_menu">{$announcement_icon}Announcement thread</a>
EOT;
$extra_info = $install_info . <<<EOT
    <a href="index.php?file=absolute_url/admin" class="admin_menu">{$config_icon}{$name} {$lang_gallery_admin_menu['admin_lnk']}</a>
EOT
;
Beispiel #26
0
function image_manipulation_configure()
{
    global $CONFIG, $CPG_PLUGINS, $lang_plugin_image_manipulation;
    require './plugins/image_manipulation/init.inc.php';
    $icon_array['ok'] = cpg_fetch_icon('ok', 1);
    $icon_array['cancel'] = cpg_fetch_icon('cancel', 1);
    $allow_continue = 1;
    echo <<<EOT
    <form action="" method="post" name="image_manipulation_config" id="image_manipulation_config">
        <ul>
EOT;
    if ($CONFIG['transparent_overlay'] != '0') {
        echo <<<EOT
            <li>{$lang_plugin_image_manipulation['transparent_overlay_warning']}
            {$lang_plugin_image_manipulation['continue_will_disable_warning']}
            {$lang_plugin_image_manipulation['do_not_turn_on_again']}</li>
EOT;
    }
    if (($plugin_id = CPGPluginAPI::installed('mirror')) !== false) {
        $warning_coexist = sprintf($lang_plugin_image_manipulation['plugins_cant_coexist'], '<em>Mirror</em>');
        echo <<<EOT
            <li>{$warning_coexist}</li>
EOT;
        $allow_continue = 0;
    }
    echo <<<EOT
        </ul>
EOT;
    if ($allow_continue == 1) {
        echo <<<EOT
        <input type="hidden" name="image_manipulation_continue_anyway" id="image_manipulation_continue_anyway" value="1" />
        <button type="submit" class="button" name="submit" value="{$lang_plugin_image_manipulation['continue_anyway']}">{$icon_array['ok']}{$lang_plugin_image_manipulation['continue_anyway']}</button>
EOT;
    }
    echo <<<EOT
        <a href="pluginmgr.php" class="admin_menu">{$icon_array['cancel']}{$lang_plugin_image_manipulation['cancel']}</a>
EOT;
    echo <<<EOT
    </form>
EOT;
}
Beispiel #27
0
                {$lang_plugin_limit_upload['saved']}
            </td>
        </tr>
EOT;
    endtable();
    echo '<br />';
}
echo '<form action="index.php?file=limit_upload/admin" method="post">';
starttable("100%", $lang_plugin_limit_upload['limit_upload'] . " - " . $lang_gallery_admin_menu['admin_lnk'], 3);
$upload_limit = mysql_result(cpg_db_query("SELECT value FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'limit_upload_upload_limit'"), 0);
$time_limit = mysql_result(cpg_db_query("SELECT value FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'limit_upload_time_limit'"), 0);
foreach ($lang_plugin_limit_upload['upload_limit_values'] as $key => $value) {
    $selected = $time_limit == $key ? 'selected="selected"' : '';
    $time_limit_options .= "<option value=\"{$key}\" {$selected}>{$value}</option>";
}
$submit_icon = cpg_fetch_icon('ok', 1);
echo <<<EOT
    <tr>
        <td class="tableb">
            {$lang_plugin_limit_upload['upload_limit']}
        </td>
        <td class="tableb">
            <input type="input" class="listbox" size="5" name="upload_limit" id="plugin_limit_upload_files" value="{$upload_limit}" /> <select class="listbox" name="time_limit">{$time_limit_options}</select>
        </td>
        <td class="tableb">
            <button value="{$lang_common['apply_changes']}" name="submit" class="button" type="submit">{$submit_icon}{$lang_common['apply_changes']}</button>
        </td>
    </tr>
EOT;
endtable();
list($timestamp, $form_token) = getFormToken();
Beispiel #28
0
function annotate_meta_album($meta)
{
    global $CONFIG, $CURRENT_CAT_NAME, $RESTRICTEDWHERE, $lang_plugin_annotate;
    require_once './plugins/annotate/init.inc.php';
    $annotate_init_array = annotate_initialize();
    $lang_plugin_annotate = $annotate_init_array['language'];
    $annotate_icon_array = $annotate_init_array['icon'];
    switch ($meta['album']) {
        case 'lastnotes':
            $album_name = $annotate_icon_array['annotate'] . ' ' . $lang_plugin_annotate['lastnotes'];
            if ($CURRENT_CAT_NAME) {
                $album_name .= " - {$CURRENT_CAT_NAME}";
            }
            $query = "SELECT DISTINCT n.pid \n                FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate AS n \n                INNER JOIN {$CONFIG['TABLE_PICTURES']} AS p ON n.pid = p.pid \n                INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON r.aid = p.aid \n                {$RESTRICTEDWHERE}";
            $result = cpg_db_query($query);
            $count = mysql_num_rows($result);
            mysql_free_result($result);
            $query = "SELECT MAX(nid) AS nid\n                FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate AS n \n                INNER JOIN {$CONFIG['TABLE_PICTURES']} AS p ON n.pid = p.pid \n                INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON r.aid = p.aid \n                {$RESTRICTEDWHERE}\n                GROUP BY n.pid \n                ORDER BY n.nid DESC {$meta['limit']}";
            $result = cpg_db_query($query);
            $latest_nids_array = array();
            while ($row = mysql_fetch_assoc($result)) {
                $latest_nids_array[] = $row['nid'];
            }
            mysql_free_result($result);
            $query = "SELECT *, user_time AS msg_date\n                FROM {$CONFIG['TABLE_PICTURES']} AS p\n                INNER JOIN {$CONFIG['TABLE_PREFIX']}plugin_annotate AS n ON p.pid = n.pid \n                INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON r.aid = p.aid \n                {$RESTRICTEDWHERE} \n                AND approved = 'YES'\n                AND n.nid IN (" . implode(', ', $latest_nids_array) . ")\n                ORDER BY n.nid DESC";
            $result = cpg_db_query($query);
            $rowset = cpg_db_fetch_rowset($result);
            mysql_free_result($result);
            build_caption($rowset, array('msg_date'));
            break;
        case 'shownotes':
            if (annotate_get_level('permissions') < 1) {
                global $lang_errors;
                cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
            }
            $superCage = Inspekt::makeSuperCage();
            $note = $superCage->get->keyExists('note') ? $superCage->get->getRaw('note') : $superCage->cookie->getRaw($CONFIG['cookie_name'] . 'note');
            setcookie($CONFIG['cookie_name'] . 'note', $note);
            $album_name = cpg_fetch_icon('search', 2) . ' ' . $lang_plugin_annotate['shownotes'] . " '{$note}'";
            if ($CURRENT_CAT_NAME) {
                $album_name .= " - {$CURRENT_CAT_NAME}";
            }
            $note = addslashes(addslashes($note));
            $query = "SELECT p.pid FROM {$CONFIG['TABLE_PICTURES']} AS p INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON p.aid = r.aid INNER JOIN {$CONFIG['TABLE_PREFIX']}plugin_annotate n ON p.pid = n.pid {$RESTRICTEDWHERE} AND approved = 'YES' AND n.note = '{$note}' GROUP BY p.pid";
            $result = cpg_db_query($query);
            $count = mysql_num_rows($result);
            mysql_free_result($result);
            $query = "SELECT p.*, r.title FROM {$CONFIG['TABLE_PICTURES']} AS p INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON p.aid = r.aid INNER JOIN {$CONFIG['TABLE_PREFIX']}plugin_annotate n ON p.pid = n.pid {$RESTRICTEDWHERE} AND approved = 'YES' AND n.note = '{$note}' GROUP BY p.pid ORDER BY p.pid DESC {$meta['limit']}";
            $result = cpg_db_query($query);
            $rowset = cpg_db_fetch_rowset($result);
            mysql_free_result($result);
            build_caption($rowset);
            break;
        default:
            return $meta;
    }
    $meta['album_name'] = $album_name;
    $meta['count'] = $count;
    $meta['rowset'] = $rowset;
    return $meta;
}
Beispiel #29
0
function cpg_versioncheckCreateHTMLOutput($file_data_array)
{
    global $textFileExtensions_array, $lang_versioncheck_php, $lang_common, $majorVersion, $displayOption_array, $file_data_count, $maxLength_array, $subversionRepository, $imageFileExtensions_array, $LINEBREAK;
    $loopCounter_array = array('total' => 0, 'error' => 0, 'display' => 0);
    if (strlen($file_data_count) > $maxLength_array['counter']) {
        $maxLength_array['counter'] = strlen($file_data_count);
    }
    if (function_exists('cpg_fetch_icon')) {
        $ok_icon = cpg_fetch_icon('ok', 0);
        $cancel_icon = '&nbsp;' . cpg_fetch_icon('cancel', 0);
        $stop_icon = '&nbsp;' . cpg_fetch_icon('stop', 0);
    } else {
        $ok_icon = '(' . $lang_common['ok'] . ')';
        $cancel_icon = ' (?)';
        $stop_icon = ' (!)';
    }
    // the caption for the table
    print <<<EOT
<table align="center" width="100%" cellspacing="1" cellpadding="0" class="maintable">
  <tr>
          <td class="tableh2" colspan="9">{$lang_versioncheck_php['versioncheck_output']}</td>
  </tr>
  <tr>
    <th class="tableh2" style="font-size:8px">{$lang_versioncheck_php['path']}</th>
    <th class="tableh2" style="font-size:8px">{$lang_versioncheck_php['missing']}</th>
    <th class="tableh2" style="font-size:8px">{$lang_versioncheck_php['permissions']}</th>
    <th class="tableh2" style="font-size:8px">{$lang_versioncheck_php['version']}</th>
    <th class="tableh2" style="font-size:8px">{$lang_versioncheck_php['revision']}</th>
EOT;
    if (isset($displayOption_array['no_modification_check']) && $displayOption_array['no_modification_check'] != 1) {
        print <<<EOT
    <th class="tableh2" style="font-size:8px">{$lang_versioncheck_php['modified']}</th>
EOT;
    }
    print <<<EOT
    <th class="tableh2" style="font-size:8px">{$lang_versioncheck_php['comment']}</th>
    <th class="tableh2" style="font-size:8px">{$lang_versioncheck_php['repository_link']}</th>
  </tr>
EOT;
    foreach ($file_data_array as $file_data_values) {
        if (isset($displayOption_array['hide_images']) && $displayOption_array['hide_images'] && in_array($file_data_values['extension'], $imageFileExtensions_array) == TRUE) {
            // Only display image if corresponding option is not enabled --- start
            // Do nothing
        } else {
            if ($loopCounter_array['display'] / 2 == floor($loopCounter_array['display'] / 2)) {
                $cellstyle = 'tableb tableb_alternate';
            } else {
                $cellstyle = 'tableb';
            }
            if (isset($file_data_values['txt_missing'])) {
                if ($file_data_values['txt_missing'] == $lang_versioncheck_php['removed'] . ' (' . $lang_common['ok'] . ')') {
                    $file_data_values['link_start'] = '<s>';
                    $file_data_values['link_end'] = '</s>';
                } elseif ($file_data_values['txt_missing'] != '') {
                    $file_data_values['link_start'] = '<a href="' . $file_data_values['fullpath'] . '">';
                    $file_data_values['link_end'] = '</a>';
                }
            } else {
                $file_data_values['link_start'] = $file_data_values['link_end'] = '';
            }
            $important['path'] = '';
            $important['missing'] = '';
            $important['readwrite'] = '';
            $important['version'] = '';
            $important['revision'] = '';
            $important['comment'] = '';
            $important['svn'] = '';
            $important['modified'] = '';
            /*
            if ($displayOption_array['errors_only'] == 0 && $file_data_values['comment'] != '') {
              if ($file_data_values['txt_missing'] == $lang_versioncheck_php['mandatory']) {
                $important['missing'] = ' important';
              }
              if ($file_data_values['txt_missing'] == $lang_versioncheck_php['existing']) {
                $important['missing'] = ' important';
              }
            }
            */
            // spice up the output by replacing plain text with icons --- start
            $file_data_values['txt_missing'] = isset($file_data_values['txt_missing']) ? str_replace('(' . $lang_common['ok'] . ')', $ok_icon, $file_data_values['txt_missing']) : '';
            $file_data_values['txt_version'] = str_replace('(' . $lang_common['ok'] . ')', $ok_icon, $file_data_values['txt_version']);
            $file_data_values['txt_revision'] = str_replace('(' . $lang_common['ok'] . ')', $ok_icon, $file_data_values['txt_revision']);
            $file_data_values['txt_version'] = str_replace('(?)', $cancel_icon, $file_data_values['txt_version']);
            $file_data_values['txt_revision'] = str_replace('(?)', $cancel_icon, $file_data_values['txt_revision']);
            $file_data_values['txt_version'] = str_replace('(!)', $stop_icon, $file_data_values['txt_version']);
            $file_data_values['txt_revision'] = str_replace('(!)', $stop_icon, $file_data_values['txt_revision']);
            $file_data_values['txt_missing'] = str_replace($lang_versioncheck_php['mandatory'], $lang_versioncheck_php['mandatory'] . $stop_icon, $file_data_values['txt_missing']);
            $file_data_values['txt_modified'] = isset($file_data_values['txt_modified']) ? str_replace('(' . $lang_common['ok'] . ')', $ok_icon, $file_data_values['txt_modified']) : '';
            if (isset($displayOption_array['no_modification_check']) && $displayOption_array['no_modification_check'] != 1) {
                $file_data_values['txt_modified'] = str_replace('(!)', $cancel_icon, $file_data_values['txt_modified']);
            }
            // spice up the output by replacing plain text with icons --- end
            $loopCounter_array['total']++;
            if ($displayOption_array['errors_only'] == 0 || $displayOption_array['errors_only'] == 1 && $file_data_values['comment'] != '') {
                // only display if corrsponding option is not disabled --- start
                if ($file_data_values['comment'] != '') {
                    $loopCounter_array['error']++;
                }
                if (!isset($file_data_values['local_readwrite'])) {
                    $file_data_values['local_readwrite'] = '';
                }
                if (!isset($file_data_values['txt_readwrite'])) {
                    $file_data_values['txt_readwrite'] = '';
                }
                print <<<EOT
        <tr>
          <td class="{$cellstyle}{$important['path']}" align="left" style="font-size:9px">{$file_data_values['icon']}{$file_data_values['link_start']}{$file_data_values['fullpath']}{$file_data_values['link_end']}</td>
          <td class="{$cellstyle}{$important['missing']}" align="left" style="font-size:9px">{$file_data_values['txt_missing']}</td>
          <td class="{$cellstyle}{$important['readwrite']}" align="left" style="font-size:9px">{$file_data_values['local_readwrite']}{$file_data_values['txt_readwrite']}</td>
          <td class="{$cellstyle}{$important['version']}" align="left" style="font-size:9px">{$file_data_values['local_version']}{$file_data_values['txt_version']}</td>
          <td class="{$cellstyle}{$important['revision']}" align="left" style="font-size:9px">{$file_data_values['local_revision']}{$file_data_values['txt_revision']}</td>
EOT;
                if (isset($displayOption_array['no_modification_check']) && $displayOption_array['no_modification_check'] != 1) {
                    print <<<EOT
          <td class="{$cellstyle}{$important['modified']}" align="left" style="font-size:9px">{$file_data_values['local_modified']}{$file_data_values['txt_modified']}</td>
EOT;
                }
                print <<<EOT
          <td class="{$cellstyle}{$important['comment']}" align="left" style="font-size:9px">{$file_data_values['comment']}</td>
          <td class="{$cellstyle}{$important['svn']}" align="left" style="font-size:9px"><a href="{$subversionRepository}{$majorVersion}/{$file_data_values['fullpath']}"><img src="images/icons/subversion.png" width="16" height="16" border="0" alt="" title="{$lang_versioncheck_php['browse_corresponding_page_subversion']}" /></a></td>
        </tr>
EOT;
            }
            $loopCounter_array['display']++;
        }
        // only display if corrsponding option is not disabled --- end
    }
    print $LINEBREAK . '</table>';
    return $loopCounter_array;
}
    }
    $sql = "DELETE FROM {$cpg_udb->sessionstable} WHERE session_id = '" . md5($CLEAN['key'] . $CLEAN['id']) . "'";
    cpg_db_query($sql);
    // output the message
    pageheader($lang_forgot_passwd_php['forgot_passwd'], "<META http-equiv=\"refresh\" content=\"3;url=login.php\">");
    $referer = 'login.php';
    msg_box($lang_forgot_passwd_php['forgot_passwd'], sprintf($lang_forgot_passwd_php['email_sent'], $row['user_email']), $lang_common['continue'], $referer);
    $USER_DATA['user_password'] = '******';
    pagefooter();
    exit;
}
pageheader($lang_forgot_passwd_php['forgot_passwd']);
echo '<form action="forgot_passwd.php" method="post" name="passwordreminder" id="cpgform">';
$email_icon = cpg_fetch_icon('mail', 2);
$ok_icon = cpg_fetch_icon('ok', 2);
starttable('-1', cpg_fetch_icon('key_enter', 2) . $lang_forgot_passwd_php['forgot_passwd'], 2);
echo <<<EOT
            {$lookup_failed}
                 <tr>
                        <td class="tableb" width="40%">{$email_icon}{$lang_forgot_passwd_php['enter_email']}</td>
                        <td class="tableb" width="60%"><input type="text" class="textinput" name="email" style="width: 100%" /></td>

                  </tr>
                  <tr>
                        <td colspan="2" align="center" class="tablef">
                            <script language="javascript" type="text/javascript">
                            <!--
                            document.passwordreminder.email.focus();
                            -->
                            </script>
                            <!--<input name="submitted" type="submit" class="button" value="{$lang_forgot_passwd_php['submit']}" />-->