function show_memberlist()
{
    cpg_db_query("DELETE FROM {$CONFIG['TABLE_USERS']} WHERE user_name = '' LIMIT 1");
    pageheader($lang_usermgr_php['title']);
    list_users();
    pagefooter();
}
Example #2
0
 function message($title, $message, $link, $time = 2)
 {
     global $CONFIG;
     if ($CONFIG['display_redirection_page'] == 0) {
         header("Location: {$link}&message_id=" . cpgStoreTempMessage($message));
     } else {
         pageheader($title, "<META http-equiv=\"refresh\" content=\"{$time};url={$link}\">");
         msg_box($title, $message, Lang::item('common.continue'), $link);
         pagefooter();
     }
     exit;
 }
Example #3
0
function fix_ratepic()
{
    //replaces distribution ratepic by function to manage votes
    if (defined("RATEPIC_PHP")) {
        global $CONFIG;
        // Check if required parameters are present
        if (!isset($_GET['pic']) || !isset($_GET['rate'])) {
            return "";
        }
        $pic = (int) $_GET['pic'];
        $rate = (int) $_GET['rate'];
        $rate = min($rate, 10);
        $rate = max($rate, 1);
        // If user does not accept script's cookies, we don't accept the vote
        if (!isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
            header('Location: displayimage.php?pos=' . -$pic);
            exit;
        }
        // If referer is not displayimage.php we don't accept the vote
        if (!eregi("displayimage", $_SERVER["HTTP_REFERER"])) {
            header('Location: displayimage.php?pos=' . -$pic);
            exit;
        }
        // Retrieve picture/album information & check if user can rate picture, and if this is a contest - else let go to normal ratepic
        $sql = "SELECT a.votes as votes_allowed, a.contest, p.votes as votes, pic_rating, owner_id " . "FROM {$CONFIG['TABLE_PICTURES']} AS p, {$CONFIG['TABLE_ALBUMS']} AS a " . "WHERE p.aid = a.aid AND pid = '{$pic}' LIMIT 1";
        $result = cpg_db_query($sql);
        if (!mysql_num_rows($result)) {
            return "";
        }
        $row = mysql_fetch_array($result);
        if (!USER_CAN_RATE_PICTURES || $row['votes_allowed'] == 'NO' || $row['contest'] == 'NO') {
            return "";
        }
        //removed previous votes for USER_ID
        cpg_db_query("DELETE FROM `{$CONFIG['TABLE_PREFIX']}user_votes` WHERE pid = {$pic} AND user_id  = " . USER_ID);
        // insert new vote
        cpg_db_query("INSERT INTO `{$CONFIG['TABLE_PREFIX']}user_votes` SET pid = {$pic}, rating = {$rate},user_id  = " . USER_ID);
        // get average rating and store them with the image
        $result = cpg_db_query("SELECT COUNT(rating), SUM(rating) FROM `{$CONFIG['TABLE_PREFIX']}user_votes` WHERE pid = {$pic}");
        if ($row = mysql_fetch_array($result)) {
            $count = $row[0];
            $average = round($row[1] * 2000.0 / $count);
        } else {
            $count = 0;
            $average = 0;
        }
        $result = cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']}  SET pic_rating = '{$average}', votes = {$count}  WHERE pid = '{$pic}' LIMIT 1");
        // record the details of hits for the picture if the option is set in CONFIG
        if ($CONFIG['vote_details']) {
            $client_details = cpg_determine_client();
            $os = $client_details['os'];
            $browser = $client_details['browser'];
            $time = time();
            $referer = addslashes(htmlentities($_SERVER['HTTP_REFERER']));
            cpg_db_query("INSERT INTO {$CONFIG['TABLE_VOTE_STATS']} SET pid = {$pic},rating = {$rate},Ip   = '{$raw_ip}',sdate = '{$time}',referer = '{$referer}',browser = '{$browser}',os = '{$os}'");
        }
        $location = "displayimage.php?pos=" . -$pic;
        $header_location = @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ? 'Refresh: 0; URL=' : 'Location: ';
        header($header_location . $location);
        pageheader($lang_info, "<META http-equiv=\"refresh\" content=\"1;url={$location}\">");
        msg_box($lang_info, $lang_rate_pic_php['rate_ok'], $lang_continue, $location);
        pagefooter();
        ob_end_flush();
    }
    return "";
}
Example #4
0
  $LastChangedBy$
  $Date$
  **************************************************/
if (!GALLERY_ADMIN_MODE) {
    cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
}
require_once "./plugins/limit_upload/lang/english.php";
if ($CONFIG['lang'] != 'english' && file_exists("./plugins/limit_upload/lang/{$CONFIG['lang']}.php")) {
    require_once "./plugins/limit_upload/lang/{$CONFIG['lang']}.php";
}
$plugin_limit_upload_icon_array['submit'] = cpg_fetch_icon('ok', 1);
if (in_array('js/jquery.spinbutton.js', $JS['includes']) != TRUE) {
    $JS['includes'][] = 'js/jquery.spinbutton.js';
}
$JS['includes'][] = 'plugins/limit_upload/script.js';
pageheader($lang_plugin_limit_upload['limit_upload'] . " - " . $lang_gallery_admin_menu['admin_lnk']);
$superCage = Inspekt::makeSuperCage();
global $lang_common;
if ($superCage->post->keyExists('submit')) {
    if (!checkFormToken()) {
        global $lang_errors;
        cpg_die(ERROR, $lang_errors['invalid_form_token'], __FILE__, __LINE__);
    }
    if (is_numeric($superCage->post->getInt('upload_limit'))) {
        if ($superCage->post->getInt('upload_limit') >= 0) {
            cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '" . $superCage->post->getInt('upload_limit') . "' WHERE name = 'limit_upload_upload_limit'");
        }
    }
    if (array_key_exists($superCage->post->getAlpha('time_limit'), $lang_plugin_limit_upload['upload_limit_values'])) {
        cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '" . $superCage->post->getAlpha('time_limit') . "' WHERE name = 'limit_upload_time_limit'");
    }
<table class="pms_legend" cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr><td><img src="{$THEME_DIR}images/s_neg.gif" border="0" alt="" /></td><td class="smallfont">&nbsp;&nbsp;{$lang_photoshop_admin['pos']}</td></tr>
<tr><td><img src="{$THEME_DIR}images/s_pos.gif" border="0" alt="" /></td><td class="smallfont">&nbsp;&nbsp;{$lang_photoshop_admin['neg']}</td></tr>


EOT;
    endtable();
    pagefooter();
    ob_end_flush();
} else {
    //display specific order oid
    $result = $cpg_udb->photo_shop_fetch_user($oid);
    $row = mysql_fetch_assoc($result);
    mysql_free_result($result);
    pageheader($lang_photoshop_admin['o_board_title']);
    echo <<<EOT
<form action="index.php?file=photo_shop/photo_shop_myorders" method="post" name="form">
<table class="maintable" cellpadding="0" cellspacing="1" border="0" width="100%" align="center">
<thead>
\t<tr>
\t\t<td class="tableh1" colspan="4" style="padding: 6px 0 6px 6px">
\t\t\t<span class="smallfont" style="float:right">
\t\t\t\t<label for="checkall_all">
\t\t\t\t{$lang_photoshop_admin['order_id']}: <strong>{$oid}</strong>&nbsp;
\t\t\t\t</label>
\t\t\t</span>
\t\t\t<strong>{$lang_photoshop_admin['order_id']}</strong>: {$oid} - <strong>{$lang_photoshop_admin['items']}</strong>: {$row['quantity']} - <strong>{$CONFIG['photo_shop_currency']} {$lang_photoshop_admin['usd_total']}</strong>: {$row['price']} {$lang_photoshop_admin['incl_ship']}<br>
\t\t\t<span style="cursor:pointer" onclick="window.location='profile.php?uid={$row['uid']}';">{$row['user_name']}</span> -
\t\t\t<span style="cursor:pointer" onclick="window.location='mailto:{$row['user_email']}';">{$row['user_email']}</span>
\t\t</td>
Example #6
0
<?php

/**************************************************
  Coppermine 1.5.x Plugin - forum
  *************************************************
  Copyright (c) 2010 foulu (Le Hoai Phuong), 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$
  **************************************************/
pageheader($fr_title ? $fr_title : Config::item('fr_title'));
print html::spacer();
print table::open(0);
print table::tds(array(array('text' => $fr_title ? $fr_title : Config::item('fr_title')), array('align' => 'right', 'text' => ($authorizer->is_user() ? html::button('forum.php?c=profile', Lang::item('home.fr_profile')) : '') . NBSP . html::button('forum.php?c=search', Lang::item('home.search')))));
print table::close();
print html::spacer();
print table::open();
print form::hidden('c', 'search');
print table::tds(array(array('class' => 'tableb', 'text' => html::span(forum::nagavitor($nagavitor)))));
print table::close();
print html::spacer();
print $fr_contents;
pagefooter();
Example #7
0
            if (!is_dir('./plugins/receive')) {
                $mask = umask(0);
                mkdir('./plugins/receive', 0777);
                umask($mask);
            }
            if (!move_uploaded_file($superCage->files->getRaw('plugin/tmp_name'), './plugins/receive/' . $file['name'])) {
                cpg_die(CRITICAL_ERROR, $lang_pluginmgr_php['copy_error'], __FILE__, __LINE__);
            }
            require_once './include/zip.lib.php';
            $zip = new Zip();
            $zip->Extract('./plugins/receive/' . $file['name'], './plugins', array(-1));
            unlink('./plugins/receive/' . $file['name']);
        }
        break;
}
pageheader($lang_pluginmgr_php['pmgr']);
if (isset($lang_pluginmgr_php['confirm_version']) != TRUE) {
    $lang_pluginmgr_php['confirm_version'] = 'Could not determine the version requirements for this plugin. This is usually an indicator that the plugin was not designed for your version of coppermine and might therefore crash your gallery. Continue anway (not recommended)?';
}
echo <<<EOT

<script language="javascript" type="text/javascript">
function confirmUninstall(text)
{
    return confirm("{$lang_pluginmgr_php['confirm_uninstall']} (" + text + ")");
}

function confirmRemove(text)
{
    return confirm("{$lang_pluginmgr_php['confirm_remove']} (" + text + ")");
}
Example #8
0
$next_target = URL::index('&amp;file=reviewcom&amp;start=' . ($start + $count) . '&amp;count=' . $count);
$prev_target = URL::index('&amp;file=reviewcom&amp;start=' . max(0, $start - $count) . '&amp;count=' . $count);
$s50 = $count == 50 ? 'selected' : '';
$s75 = $count == 75 ? 'selected' : '';
$s100 = $count == 100 ? 'selected' : '';
if ($start + $count < $comment_count) {
    $next_link = "<a href=\"{$next_target}\"><b>" . R_SEE_NEXT . "</b></a>&nbsp;&nbsp;-&nbsp;&nbsp;";
} else {
    $next_link = '';
}
if ($start > 0) {
    $prev_link = "<a href=\"{$prev_target}\"><b>" . R_SEE_PREV . "</b></a>&nbsp;&nbsp;-&nbsp;&nbsp;";
} else {
    $prev_link = '';
}
pageheader(REVIEW_TITLE);
starttable();
echo '
        <tr>
            <form action="' . URL::index("&amp;file=reviewcom&amp;start=" . $start . "&amp;count=" . $count) . '" method="post" enctype="multipart/form-data" accept-charset="' . _CHARSET . '">
                <td class="tableh1" colspan="3"><h2>' . REVIEW_TITLE . '</h2></td>
        </tr>

';
if ($nb_com_del > 0) {
    $msg_txt = sprintf(N_COMM_DEL, $nb_com_del);
    echo <<<EOT
        <tr>
                <td class="tableh2" colspan="3" align="center">
                        <br /><b>{$msg_txt}</b><br /><br />
                </td>
Example #9
0
            cpg_die(ERROR, $lang_catmgr_php['unknown_cat'], __FILE__, __LINE__);
        }
        $del_category = $result->fetchAssoc(true);
        $parent = $del_category['parent'];
        cpg_db_query("UPDATE {$CONFIG['TABLE_CATEGORIES']} SET parent = {$parent}, lft = 0 WHERE parent = {$cid}");
        cpg_db_query("UPDATE {$CONFIG['TABLE_ALBUMS']} SET category = {$parent} WHERE category = {$cid}");
        cpg_db_query("DELETE FROM {$CONFIG['TABLE_CATEGORIES']} WHERE cid = {$cid}");
        //delete from categorymap
        cpg_db_query("DELETE FROM {$CONFIG['TABLE_CATMAP']} WHERE cid = {$cid}");
        break;
}
if ($op) {
    check_rebuild_tree();
}
get_subcat_data(0);
pageheader($lang_catmgr_php['manage_cat']);
starttable('100%', cpg_fetch_icon('cat_mgr', 2) . $lang_catmgr_php['category'] . '&nbsp;' . cpg_display_help('f=categories.htm&amp;as=cat_cp&amp;ae=cat_cp_end&amp;top=1', '800', '600'), 1);
echo <<<EOT
    <tr>
        <td class="tableb">
EOT;
starttable('100%');
// configure sort category alphabetically
$yes_selected = $CONFIG['categories_alpha_sort'] ? 'checked="checked"' : '';
$no_selected = !$CONFIG['categories_alpha_sort'] ? 'checked="checked"' : '';
$help = '&nbsp;' . cpg_display_help('f=configuration.htm&amp;as=admin_album_list_alphasort_start&amp;ae=admin_album_list_alphasort_end&amp;top=1', '600', '250');
echo <<<EOT
        <tr>
            <td class="tablef" colspan="8">
                        <form name="catsortconfig" action="{$CPG_PHP_SELF}" method="post">
                        {$lang_catmgr_php['categories_alpha_sort']}
Example #10
0
        // Create thumbnail and internediate image and add the image into the DB
        $result = add_picture($album, $filepath, $picture_name, 0, $title, $caption, $keywords, $user1, $user2, $user3, $user4, $category, $raw_ip, $hdr_ip, (int) $_POST['width'], (int) $_POST['height']);
        if (!$result) {
            @unlink($uploaded_pic);
            cpg_die(CRITICAL_ERROR, sprintf($lang_db_input_php['err_insert_pic'], $uploaded_pic) . '<br /><br />' . $ERROR, __FILE__, __LINE__, true);
        } elseif ($PIC_NEED_APPROVAL) {
            pageheader($lang_info);
            msg_box($lang_info, $lang_db_input_php['upload_success'], $lang_continue, 'index.php');
            // start: send admin approval mail added by gaugau: 03-11-09
            if ($CONFIG['upl_notify_admin_email']) {
                include_once 'include/mailer.inc.php';
                cpg_mail('admin', sprintf($lang_db_input_php['notify_admin_email_subject'], $CONFIG['gallery_name']), sprintf($lang_db_input_php['notify_admin_email_body'], USER_NAME, $CONFIG['ecards_more_pic_target'] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . 'editpics.php?mode=upload_approval'));
            }
            // end: send admin approval mail
            ob_end_flush();
        } else {
            $header_location = @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ? 'Refresh: 0; URL=' : 'Location: ';
            $redirect = "displayimage.php?pos=" . -mysql_insert_id($CONFIG['LINK_ID']);
            header($header_location . $redirect);
            pageheader($lang_info, "<meta http-equiv=\"refresh\" content=\"1;url={$redirect}\" />");
            msg_box($lang_info, $lang_db_input_php['upl_success'], $lang_continue, $redirect);
            pagefooter();
            ob_end_flush();
            exit;
        }
        break;
        // Unknow event
    // Unknow event
    default:
        cpg_die(CRITICAL_ERROR, $lang_errors['param_missing'], __FILE__, __LINE__);
}
$user_id = USER_ID;
// Compose the query
$query_string = "SELECT null FROM {$CONFIG['TABLE_BANNED']} WHERE (";
if (USER_ID) {
    $query_string .= "user_id={$user_id} OR ";
}
if ($raw_ip != $hdr_ip) {
    $query_string .= "'{$raw_ip}' LIKE ip_addr OR '{$hdr_ip}' LIKE ip_addr ";
} elseif ($raw_ip != '') {
    $query_string .= "'{$raw_ip}' LIKE ip_addr ";
}
$query_string .= ") AND brute_force=0 LIMIT 1";
$result = cpg_db_query($query_string);
unset($query_string);
if (mysql_num_rows($result)) {
    pageheader($lang_common['error']);
    msg_box($lang_common['information'], $lang_errors['banned']);
    pagefooter();
    exit;
}
mysql_free_result($result);
// Retrieve the "private" album set
if (!GALLERY_ADMIN_MODE && $CONFIG['allow_private_albums']) {
    get_private_album_set();
}
if (!USER_IS_ADMIN && $CONFIG['offline'] && $CPG_PHP_SELF != 'login.php' && $CPG_PHP_SELF != 'update.php') {
    pageheader($lang_errors['offline_title']);
    msg_box($lang_errors['offline_title'], $lang_errors['offline_text']);
    pagefooter();
    exit;
}
Example #12
0
<?php

// If this file is called, all images in the database will be processed
// I don't know, if this causes a problem when there are a lot of images :-)
global $CONFIG, $flf_lang_var;
if (!GALLERY_ADMIN_MODE) {
    cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
}
pageheader($flf_lang_var['deleteallhistograms']);
require_once 'include/histotag_histogram_support.php';
starttable("90%");
$insertedvalues = deleteAllHistograms();
print $insertedvalues . " " . $flf_lang_var['deleteallhistograms_success'];
endtable();
pagefooter();
ob_end_flush();
Example #13
0
        cpg_die(ERROR, $lang_modifyalb_php['err_no_alb_to_modify'], __FILE__, __LINE__);
    }
    $ALBUM_DATA = mysql_fetch_array($results);
    $CLEAN['album'] = $ALBUM_DATA['aid'];
} else {
    //$album = (int)$_GET['album'];
    $results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='{$CLEAN['album']}'");
    if (!mysql_num_rows($results)) {
        cpg_die(CRITICAL_ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
    }
    $ALBUM_DATA = mysql_fetch_array($results);
}
$cat = $ALBUM_DATA['category'];
$actual_cat = $cat;
//////////// main code start ///////////////////
pageheader(sprintf($lang_modifyalb_php['upd_alb_n'], $ALBUM_DATA['title']));
$album_lb = alb_list_box();
$help = '&nbsp;' . cpg_display_help('f=albums.htm&amp;as=album_prop&amp;ae=album_prop_end&amp;top=1', '600', '400');
starttable("100%", $lang_modifyalb_php['update'] . $help, 2);
echo <<<EOT
        <tr>
            <td class="tableh2" align="center">
                <a href="editpics.php?album={$CLEAN['album']}" class="admin_menu">{$lang_modifyalb_php['edit_files']}</a>
                &nbsp;&nbsp;-&nbsp;&nbsp;
                <a href="index.php?cat={$ALBUM_DATA['category']}" class="admin_menu">{$lang_modifyalb_php['parent_category']}</a>
                &nbsp;&nbsp;-&nbsp;&nbsp;
                <a href="thumbnails.php?album={$CLEAN['album']}" class="admin_menu">{$lang_modifyalb_php['thumbnail_view']}</a>
            </td>
            <td class="tableh2" align="right">
            {$album_lb}
            </td>
Example #14
0
}
global $db;
if (!USER_ID) {
    cpg_die(_ERROR, ACCESS_DENIED);
}
//, __FILE__, __LINE__
$sql = "SELECT username, user_email, user_regdate as user_regdate_cp, group_name, " . "user_from, user_interests, user_website, user_occ, " . "COUNT(pid) as pic_count, ROUND(SUM(total_filesize)/1024) as disk_usage, group_quota " . "FROM {$CONFIG['TABLE_USERS']} AS u " . "INNER JOIN {$CONFIG['TABLE_USERGROUPS']} AS g ON user_group_cp = group_id " . "LEFT JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON category = " . FIRST_USER_CAT . " + user_id " . "LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.aid = a.aid " . "WHERE user_id ='" . USER_ID . "' " . "GROUP BY user_id, username, user_email, user_regdate, group_name, user_from, user_interests, user_website, user_occ, group_quota";
$result = $db->sql_query($sql);
if (!$db->sql_numrows($result)) {
    cpg_die(_ERROR, $lang_register_php['err_unk_user'], __FILE__, __LINE__);
}
$user_data = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$form_data = array('username' => $user_data['username'], 'reg_date' => localised_date($user_data['user_regdate_cp'], REGISTER_DATE_FMT), 'group' => $user_data['group_name'], 'email' => $user_data['user_email'], 'disk_usage' => $user_data['disk_usage'] ? $user_data['disk_usage'] : 0 . ($user_data['group_quota'] ? '/' . $user_data['group_quota'] : '') . ' ' . $lang_byte_units[1], 'location' => $user_data['user_from'], 'interests' => $user_data['user_interests'], 'website' => $user_data['user_website'], 'occupation' => $user_data['user_occ']);
$title = sprintf(X_S_PROFILE, CPG_USERNAME);
pageheader($title);
starttable(-1, $title, 2);
$chset = _CHARSET;
echo '<form method="post" action="' . URL::index("") . '" enctype="multipart/form-data" accept-charset="$chset">';
make_form($edit_profile_form_param, $form_data);
echo <<<EOT
        
        </form>

EOT;
endtable();
if (defined('CPG_NUKE')) {
    get_lang("Your_Account");
    require_once 'modules/Your_Account/functions.php';
    require "modules/Your_Account/userinfo.php";
    userinfo(USER_ID);
Example #15
0
                print '</form>';
            }
            // end if error
            break;
    }
    print "<br />\n";
    pagefooter();
} else {
    // not in gallery admin mode --- start
    if ($CONFIG['bridge_enable'] != 1) {
        cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
    }
    // initialize vars
    $step = $_POST['step'];
    $new_line = "\n";
    pageheader($lang_bridgemgr_php['title']);
    switch ($step) {
        case "attempt_to_disable":
            // check if the wait time is over; if it isn't, send them back
            $results = cpg_db_query("SELECT value FROM {$CONFIG['TABLE_BRIDGE']} WHERE name = 'recovery_logon_timestamp'");
            if (mysql_num_rows($results)) {
                $row = mysql_fetch_array($results);
            }
            $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 (mysql_num_rows($results)) {
                $row = mysql_fetch_array($results);
            }
            $recovery_logon_failures = $row['value'];
            $logon_allowed = cpg_check_allowed_emergency_logon($recovery_logon_timestamp, $recovery_logon_failures);
Example #16
0
                $value = addslashes($post[$element[1]]);
                if ($MINICMS[$element[1]] !== stripslashes($value)) {
                    cpg_db_query("UPDATE {$CONFIG['TABLE_CMS_CONFIG']} SET value = '{$value}' WHERE name = '{$element[1]}'");
                    if ($CONFIG['log_mode'] == CPG_LOG_ALL) {
                        log_write('CONFIG UPDATE SQL: ' . "UPDATE {$CONFIG['TABLE_CMS_CONFIG']} SET value = '{$value}' WHERE name = '{$element[1]}'\n" . 'TIME: ' . date("F j, Y, g:i a") . "\n" . 'USER: '******'user_name'], CPG_DATABASE_LOG);
                    }
                }
            }
        }
        pageheader($lang_minicms['minicms']);
        msg_box($lang_minicms['minicms'], $lang_minicms['page_success'], $lang_common['continue'], 'index.php');
    }
    pagefooter();
    exit;
}
pageheader($lang_minicms['minicms']);
$signature = 'Coppermine Photo Gallery ' . COPPERMINE_VERSION . ' (' . COPPERMINE_VERSION_STATUS . ')';
//echo "<form action=\"$PHP_SELF\" method=\"post\">";
echo "<form action=\"" . $CPG_PHP_SELF . '?file=minicms/cms_config' . "\" method=\"post\">";
starttable('100%', "{$lang_minicms['minicms']} - {$signature}", 2);
create_form($lang_minicms_config);
echo '</table></td></tr>';
echo <<<EOT
                <tr>
                        <td align="left" class="tablef">
                            <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                <tr>
                                    <td width="67%" align="center">
                                        <input type="submit" class="button" name="update_config" value="{$lang_common['continue']}" />
                                &nbsp;&nbsp;
                                    </td>
Example #17
0
    $direction = "rtl";
}
//Définition des variables
if ($superCage->get->keyExists('dfolder')) {
    $dfolder = $superCage->get->getRaw('dfolder');
}
if ($superCage->get->keyExists('selection')) {
    $selection = $superCage->get->getRaw('selection');
}
if ($superCage->get->keyExists('selection1')) {
    $selection1 = $superCage->get->getRaw('selection1');
}
$titre = $lang_plugin_FileMove['folder_ar'];
$Drep = path_name($dfolder);
//affichagede l'entête
pageheader($lang_plugin_FileMove['display_name']);
if ($superCage->post->keyExists('file_name')) {
    $directory = "./" . $CONFIG['fullpath'];
    $Drep = path_name($dfolder);
    $selection = "ok";
    starttable('100%', $titre);
    echo "<tr><td class='tableh2'align='left'>{$lang_plugin_FileMove['DFolder']}<b>{$Drep}</b></td></tr>";
    echo "<tr><td class='tableh2'align='left'>{$lang_plugin_FileMove['confirm_files']}</td></tr>";
    echo "<tr><td class='tableh2'>";
    $filename = $superCage->post->getRaw('file_name');
    setcookie($CONFIG['cookie_name'] . '_filemove', base64_encode(serialize($filename)), 0, $CONFIG['cookie_path']);
    foreach ($filename as $n => $name) {
        echo $name . "&nbsp;&nbsp;";
    }
    echo "</td></tr>";
    echo "<tr><td class='tableh1' align='center'><b>{$lang_plugin_FileMove['folder_ar']}</b></td></tr>";
Example #18
0
 } else {
     $PAGE = 1;
 }
 // Gather data for categories
 $breadcrumb = '';
 $cat_data = array();
 $statistics = '';
 $STATS_IN_ALB_LIST = false;
 $cpg_show_private_album = $CONFIG['allow_private_albums'] ? $CONFIG['show_private'] : true;
 if (isset($cat)) {
     get_meta_album_set($cat);
 } else {
     get_meta_album_set(0);
 }
 get_cat_list($breadcrumb, $cat_data, $statistics);
 pageheader($BREADCRUMB_TEXT ? $BREADCRUMB_TEXT : $lang_index_php['welcome']);
 $elements = explode('/', $CONFIG['main_page_layout']);
 $elements = CPGPluginAPI::filter('main_page_layout', $elements);
 /**
  * Loop through the $elements array to build the page using the parameters
  * set in the config
  */
 foreach ($elements as $element) {
     if (preg_match("/(\\w+),*(\\d+)*/", $element, $matches)) {
         if (!isset($matches[2])) {
             // added to fix notice about undefined index
             $matches[2] = 0;
         }
         $matches = CPGPluginAPI::filter('plugin_block', $matches);
         if (is_array($matches)) {
             switch ($matches[1]) {
Example #19
0
    }
}
if ($superCage->post->keyExists('del_sel') && $superCage->post->keyExists('delete_group')) {
    $delete_group_arr = $superCage->post->getInt('delete_group');
    if (is_array($delete_group_arr)) {
        foreach ($delete_group_arr as $group_id) {
            cpg_db_query("DELETE FROM {$CONFIG['TABLE_USERGROUPS']} WHERE group_id = '" . (int) $group_id . "' LIMIT 1");
            cpg_db_query("UPDATE {$CONFIG['TABLE_USERS']} SET user_group = '2' WHERE user_group = '" . (int) $group_id . "'");
        }
    }
} elseif ($superCage->post->keyExists('new_group')) {
    cpg_db_query("INSERT INTO {$CONFIG['TABLE_USERGROUPS']} (group_name) VALUES ('')");
} elseif ($superCage->post->keyExists('apply_modifs')) {
    process_post_data();
}
pageheader($lang_groupmgr_php['title']);
echo <<<EOT

<script language="javascript" type="text/javascript">
<!--//<![CDATA[
function confirmDel()
{
    return confirm("{$lang_groupmgr_php['confirm_del']}");
}

function selectAll(d,box) {
  var f = document.groupmanager;
  for (i = 0; i < f.length; i++) {
    //alert (f[i].name.indexOf(box));
    if (f[i].type == "checkbox" && f[i].name.indexOf(box) >= 0) {
      if (d.checked) {
}
if ($sortDirection == 'ASC') {
    $sortDirectionText = $lang_db_ecard_php['ecard_ascending'];
}
// determine the total number of entries
$result = mysql_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_ECARDS']}");
if (!mysql_num_rows($result)) {
    cpg_die(ERROR, $lang_errors['ecards_empty'], __FILE__, __LINE__, false);
}
$totalEcards = mysql_fetch_array($result);
$totalEcards = $totalEcards[0];
$result = mysql_query("SELECT eid, sender_name, sender_email, recipient_name, recipient_email, link, date, sender_ip FROM {$CONFIG['TABLE_ECARDS']} ORDER BY {$sortBy} {$sortDirection} LIMIT {$startFrom},{$countTo}");
if (!mysql_num_rows($result)) {
    cpg_die(ERROR, $lang_errors['ecards_empty'], __FILE__, __LINE__, false);
}
pageheader($lang_db_ecard_php['title']);
$formTarget = cpgGetUrlVars('count');
print '<form method="post" name="ecardselect" action="' . $formTarget . '" onSubmit="return defaultagree(this)">';
?>
<script language="javascript" type="text/javascript">
<!--
function checkAll(field)
{
for (i = 0; i < field.length; i++)
  field[i].checked = true ;
}

function uncheckAll(field)
{
for (i = 0; i < field.length; i++)
  field[i].checked = false ;
Example #21
0
  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$
  **************************************************/
if (!GALLERY_ADMIN_MODE) {
    cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
}
pageheader("BBCode Control - " . $lang_gallery_admin_menu['admin_lnk']);
$superCage = Inspekt::makeSuperCage();
global $lang_common;
// language detection
$lang = isset($CONFIG['lang']) ? $CONFIG['lang'] : 'english';
include 'plugins/bbcode_control/lang/english.php';
if (in_array($lang, $enabled_languages_array) == TRUE && file_exists('plugins/bbcode_control/lang/' . $lang . '.php')) {
    include 'plugins/bbcode_control/lang/' . $lang . '.php';
}
// add recently added BBCodes to database
$bbcode_tags = get_bbcode_tags('available');
foreach ($bbcode_tags as $tag) {
    insert_into_config('bbcode_control_tag_' . $tag . '_show', '1');
    insert_into_config('bbcode_control_tag_' . $tag . '_process', '1');
}
if ($superCage->post->keyExists('submit')) {
        $USER_DATA['user_password'] = '******';
        pagefooter();
        exit;
        // something has been found end
    } else {
        $lookup_failed = <<<EOT
                  <tr>
                          <td colspan="2" align="center" class="tableh2">
                        <font size="1" color="red"><b>{$lang_forgot_passwd_php['err_unk_user']}<b></font>
                        </td>
                  </tr>

EOT;
    }
}
pageheader($lang_forgot_passwd_php['forgot_passwd']);
echo '<form action="forgot_passwd.php" method="post" name="passwordreminder">';
starttable('-1', $lang_forgot_passwd_php['forgot_passwd'], 2);
echo <<<EOT
            {$lookup_failed}
                 <tr>
                        <td class="tableb" width="40%">{$lang_forgot_passwd_php['enter_username_email']}</td>
                        <td class="tableb" width="60%"><input type="text" class="textinput" name="username" style="width: 100%"></td>
                        <script language="javascript" type="text/javascript">
                        <!--
                        document.passwordreminder.username.focus();
                        -->
                        </script>
                  </tr>
                  <tr>
                        <td colspan="2" align="center" class="tablef"><input name="submitted" type="submit" class="button" value="{$lang_forgot_passwd_php['submit']}"></td>
Example #23
0
$next_target = $_SERVER['PHP_SELF'] . '?start=' . ($start + $count) . '&amp;count=' . $count;
$prev_target = $_SERVER['PHP_SELF'] . '?start=' . max(0, $start - $count) . '&amp;count=' . $count;
$s50 = $count == 50 ? 'selected' : '';
$s75 = $count == 75 ? 'selected' : '';
$s100 = $count == 100 ? 'selected' : '';
if ($start + $count < $comment_count) {
    $next_link = "<a href=\"{$next_target}\" class=\"admin_menu\">{$lang_reviewcom_php['see_next']}&raquo;</a>&nbsp;&nbsp;-&nbsp;&nbsp;";
} else {
    $next_link = '';
}
if ($start > 0) {
    $prev_link = "<a href=\"{$prev_target}\" class=\"admin_menu\">&laquo;{$lang_reviewcom_php['see_prev']}</a>&nbsp;&nbsp;-&nbsp;&nbsp;";
} else {
    $prev_link = '';
}
pageheader($lang_reviewcom_php['title']);
echo <<<EOT
<script type="text/javascript" language="javascript">
<!--
function textCounter(field, maxlimit) {
        if (field.value.length > maxlimit) // if too long...trim it!
        field.value = field.value.substring(0, maxlimit);
}

function selectAll(d,box) {
  var f = document.editForm;
  for (i = 0; i < f.length; i++) {
    //alert (f[i].name.indexOf(box));
    if (f[i].type == "checkbox" && f[i].name.indexOf(box) >= 0) {
      if (d.checked) {
        f[i].checked = true;
Example #24
0
                    $config_changes_counter++;
                }
            }
            // type is array --- end
        }
        // only loop if config value is set --- end
    }
}
// display config page
// Set the option output stuff
if ($CONFIG['plugin_template_adminmode'] == '1') {
    $option_output['plugin_template_adminmode'] = 'checked="checked"';
} else {
    $option_output['plugin_template_adminmode'] = '';
}
pageheader(sprintf($lang_plugin_template['configure_x'], $lang_plugin_template['plugin_name']));
list($timestamp, $form_token) = getFormToken();
echo <<<EOT
<form action="index.php?file=template/admin" method="post" name="template_settings">
EOT;
starttable('100%', sprintf($lang_plugin_template['configure_x'], $lang_plugin_template['plugin_name']), 3, 'cpg_zebra');
if ($superCage->post->keyExists('submit')) {
    if ($config_changes_counter > 0) {
        echo <<<EOT
    <tr>
        <td class="tablef" colspan="2" >
EOT;
        msg_box('', $lang_plugin_template['update_success'], '', '', 'success');
    } else {
        msg_box('', $lang_plugin_template['no_changes'], '', '', 'validation');
    }
Example #25
0
  **************************************************/
require_once 'include/init.inc.php';
require './plugins/slider/include/init.inc.php';
$slider_superCage = Inspekt::makeSuperCage();
global $CONFIG, $lang_plugin_slider;
if (!GALLERY_ADMIN_MODE) {
    cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
}
if ($lang_text_dir == 'ltr') {
    $align = "left";
    $direction = "ltr";
} else {
    $align = "right";
    $direction = "rtl";
}
pageheader($lang_plugin_slider['display_name']);
if ($slider_superCage->post->keyExists('update')) {
    $slider_width = $slider_superCage->post->getInt('slider_width');
    $slider_numberofpics = $slider_superCage->post->getInt('slider_numberofpics');
    $slider_speed = $slider_superCage->post->getInt('slider_speed');
    if ($enl_matches = $slider_superCage->post->getMatched('slider_bgcolor', '/^[a-zA-Z0-9#]+$/')) {
        $slider_bgcolor = $enl_matches[0];
    } else {
        $slider_bgcolor = '';
    }
    $slider_album = $slider_superCage->post->getAlnum('slider_album');
    $slider_skipportrait = $slider_superCage->post->getInt('slider_skipportrait');
    $slider_align = $slider_superCage->post->getAlnum('slider_align');
    $slider_useenlarge = $slider_superCage->post->getInt('slider_useenlarge');
    $slider_pictype = $slider_superCage->post->getAlnum('slider_pictype');
    $slider_autowidth = $slider_superCage->post->getInt('slider_autowidth');
Example #26
0
    pageheader($lang_register_php['page_title']);
    $email = $row['user_email'];
    $user_name = $row['user_name'];
    $password = $row['user_password'];
    $sql = "UPDATE {$CONFIG['TABLE_USERS']} " . "SET user_active = 'YES' " . "WHERE user_actkey = '{$act_key}' " . "LIMIT 1";
    $result = cpg_db_query($sql);
    if ($CONFIG['admin_activation'] == 1) {
        //after admin approves, user receives email notification
        msg_box($lang_register_php['information'], $lang_register_php['acct_active_admin_activation'], $lang_continue, 'index.php');
        $site_link = $CONFIG['site_url'];
        $template_vars = array('{SITE_LINK}' => $site_link, '{USER_NAME}' => $user_name, '{PASSWORD}' => $password, '{SITE_NAME}' => $CONFIG['gallery_name']);
        cpg_mail($email, sprintf($lang_register_php['notify_user_email_subject'], $CONFIG['gallery_name']), nl2br(strtr($lang_register_activated_email, $template_vars)));
    } else {
        //user self-activated, gets message box that account was activated
        msg_box($lang_register_php['information'], $lang_register_php['acct_active'], $lang_continue, 'index.php');
    }
} else {
    pageheader($lang_register_php['page_title']);
    if (isset($_POST['agree'])) {
        input_user_info();
    } elseif (isset($_POST['submit'])) {
        $errors = '';
        if (!check_user_info($errors)) {
            input_user_info($errors);
        }
    } else {
        display_disclaimer();
    }
}
pagefooter();
ob_end_flush();
Example #27
0
}
//if (!isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
if (!$superCage->cookie->keyExists($CONFIG['cookie_name'] . '_data')) {
    $cookie_warning = <<<EOT
                  <tr>
                          <td colspan="2" align="center" class="tableh2">
                        <span style="color:red"><b>{$lang_login_php['cookie_warning']}<b></span>
                        </td>
                  </tr>

EOT;
}
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>';
}
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);
echo '<form action="login.php?referer=' . urlencode($CPG_REFERER) . '" method="post" name="loginbox" id="cpgform">';
starttable('-1', $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%">{$login_method}</td>
                        <td class="tableb" width="60%"><input type="text" class="textinput" name="username" style="width: 100%" tabindex="1" /></td>
                  </tr>
if ($superCage->get->getInt('no_modification_check') == '1') {
    $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') {
Example #29
0
    echo $js;
    endtable();
    echo <<<EOT
    </form>
EOT;
    pagefooter();
}
function countup($array)
{
    $result = 0;
    foreach ($array as $a) {
        $result += is_array($a) ? countup($a) : count($a);
    }
    return $result;
}
pageheader($lang_plugin_mass_import['name']);
echo <<<EOT
<form name="form" method="POST" action="{$scriptname}">
EOT;
starttable('100%', $mass_import_icon_array['table'] . $lang_plugin_mass_import['name'], 2, 'cpg_zebra');
$post_directory = $superCage->post->getRaw('directory');
if ($superCage->post->keyExists('filelist')) {
    $filelist = unserialize(base64_decode($superCage->post->getRaw('filelist')));
    // We rely on the fact that only the admin can use this page in the first place
    $counter = 0;
    //echo '<br />';
    populatealbums();
} elseif ($superCage->post->keyExists('start')) {
    $data = dir_parse('./' . $CONFIG['fullpath'] . trim($post_directory));
    if (!$superCage->post->keyExists('directory')) {
        echo $output_array['row_start'] . $lang_plugin_mass_import['root_use'] . $output_array['row_separator'] . $output_array['row_end'];
Example #30
0
<?php

session_start();
require_once "style.php";
if ($_SESSION["uname"] == "") {
    header('location: index.php');
} else {
    pageheader("Profile", $_SESSION["name"], "", "", "", $_SESSION["status"]);
    ?>

    <?php 
    if (isset($_REQUEST['username'])) {
        $uname = $_REQUEST['username'];
        $test = mysql_query("SELECT * FROM `login` WHERE username='******'");
        $data = mysql_fetch_assoc($test);
        if ($data["status"] == 3) {
            $q = mysql_query("SELECT * FROM `login`,`student` WHERE login.username=student.username and student.username='******' LIMIT 1");
            $d = mysql_fetch_assoc($q);
            $name = $d["firstname"] . " " . $d["lastname"];
            $gender = $d["gender"];
            $institute = $d["institute"];
            $class = $d["class"];
            $email = $d["email"];
            $contact = $d["contact"];
            $address = $d["address"];
            $dateofbirth = $d["dateofbirth"];
            studentHTML($name, $gender, $institute, $class, $email, $contact, $address, $dateofbirth);
        } else {
            $q = mysql_query("SELECT * FROM `login`,`tutor` WHERE login.username=tutor.username and tutor.username='******' LIMIT 1");
            $d = mysql_fetch_assoc($q);
            $name = $d["firstname"] . " " . $d["lastname"];