Beispiel #1
0
function phpwcms_revision_r535()
{
    $status = true;
    // do former revision check – fallback to r534
    if (phpwcms_revision_check_temp('534') !== true) {
        $status = phpwcms_revision_check('534');
    }
    // change type of some content related fields from TEXT to MEDIUMTEXT
    // Retrieve Type of profession name
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_profession` WHERE Field='prof_name'");
    if (isset($result[0]['Type']) && strpos($result[0]['Type'], '100')) {
        $update = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_profession` CHANGE `prof_name` `prof_name` VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        if (!$update) {
            $status = false;
        }
    }
    // Change profession ' n/a'
    _dbUpdate('phpwcms_profession', array('prof_name' => 'n/a'), "prof_name=' n/a'");
    // Import new professions
    $result = _dbCount("SELECT COUNT(*) FROM `" . DB_PREPEND . "phpwcms_profession`");
    if ($result < 25) {
        $jobs = array('academic', 'accountant', 'actor', 'administrative services department manager', 'administrator', 'administrator, IT', 'agricultural advisor', 'air steward', 'air-conditioning installer or mechanic', 'aircraft service technician', 'ambulance driver (non paramedic)', 'animal carer (not in farms)', 'animator', 'arable farm manager, field crop or vegetable', 'arable farmer, field crop or vegetable', 'architect', 'architect, landscape', 'artist', 'asbestos removal worker', 'assembler', 'assembly team leader', 'assistant', 'author', 'baker', 'bank clerk (back-office)', 'beauty therapist', 'beverage production process controller', 'biologist', 'blogger', 'boring machine operator', 'bricklayer', 'builder', 'butcher', 'car mechanic', 'career counsellor', 'caretaker', 'carpenter', 'charge nurse', 'check-out operator', 'chef', 'child-carer', 'civil engineering technician', 'civil servant', 'cleaning supervisor', 'clerk', 'climatologist', 'cloak room attendant', 'cnc operator', 'comic book writer', 'community health worker', 'company director', 'computer programmer', 'confectionery maker', 'construction operative', 'cook', 'cooling or freezing installer or mechanic', 'critic', 'database designer', 'decorator', 'dental hygienist', 'dental prosthesis technician', 'dentist', 'department store manager', 'designer', 'designer, graphic', 'designer, industrial', 'designer, interface', 'designer, interior', 'designer, screen', 'designer, web', 'dietician', 'diplomat', 'director', 'display designer', 'doctor', 'domestic housekeeper', 'economist', 'editor', 'education advisor', 'electrical engineer', 'electrical mechanic or fitter', 'electrician', 'engineer', 'engineering maintenance supervisor', 'estate agent', 'executive', 'executive secretary', 'farmer', 'felt roofer', 'filing clerk', 'film director', 'financial clerk', 'financial services manager', 'fire fighter', 'first line supervisor beverages workers', 'first line supervisor of cleaning workers', 'fisherman', 'fishmonger', 'flight attendant', 'floral arranger', 'food scientist', 'garage supervisor', 'garbage man', 'gardener, all other', 'general practitioner', 'geographer', 'geologist', 'hairdresser', 'head groundsman', 'head teacher', 'horse riding instructor', 'hospital nurse', 'hotel manager', 'house painter', 'hr manager', 'it applications programmer', 'it systems administrator', 'jeweller', 'journalist', 'judge', 'juggler', 'kitchen assistant', 'lathe setter-operator', 'lawyer', 'lecturer', 'legal secretary', 'lexicographer', 'library assistant', 'local police officer', 'logistics manager', 'machine tool operator', 'magician', 'makeup artist', 'manager', 'manager, all other health services', 'marketing manager', 'meat processing operator', 'mechanical engineering technician', 'medical laboratory technician', 'medical radiography equipment operator', 'metal moulder', 'metal production process operator', 'meteorologist', 'midwifery professional', 'miner', 'mortgage clerk', 'musical instrument maker', 'musician', 'non-commissioned officer armed forces', 'nurse', 'nursery school teacher', 'nursing aid', 'ophthalmic optician', 'optician', 'painter', 'payroll clerk', 'personal assistant', 'personal carer in an institution for the elderly', 'personal carer in an institution for the handicapped', 'personal carer in private homes', 'personnel clerk', 'pest controller', 'photographer', 'physician assistant', 'pilot', 'pipe fitter', 'plant maintenance mechanic', 'plumber', 'police inspector', 'police officer', 'policy advisor', 'politician', 'porter', 'post secondary education teacher', 'post sorting or distributing clerk', 'power plant operator', 'primary school head', 'primary school teacher', 'printer', 'printing machine operator', 'prison officer / warder', 'product manager', 'professional gambler', 'project manager', 'programmer', 'psychologist', 'puppeteer', 'quality inspector, all other products', 'receptionist', 'restaurant cook', 'road paviour', 'roofer', 'sailor', 'sales assistant, all other', 'sales or marketing manager', 'sales representative', 'sales support clerk', 'salesperson', 'scientist', 'seaman (armed forces)', 'secondary school manager', 'secondary school teacher', 'secretary', 'security guard', 'sheet metal worker', 'ship mechanic', 'shoe repairer, leather repairer', 'shop assistant', 'sign language Interpreter', 'singer', 'social media manager', 'social photographer', 'software analyst', 'software developer', 'software engineer', 'soldier', 'solicitor', 'speech therapist', 'steel fixer', 'stockman', 'structural engineer', 'student', 'surgeon', 'surgical footwear maker', 'swimming instructor', 'system operator', 'tailor', 'tailor, seamstress', 'tax inspector', 'taxi driver', 'teacher', 'telephone operator', 'telephonist', 'theorist', 'tile layer', 'translator', 'transport clerk', 'travel agency clerk', 'travel agent', 'truck driver long distances', 'trucker', 'TV cameraman', 'TV presenter', 'university professor', 'university researcher', 'vet', 'veterinary practitioner', 'vocational education teacher', 'waiter', 'waiting staff', 'web designer', 'web developer', 'webmaster', 'welder, all other', 'wood processing plant operator', 'writer', 'other', 'n/a');
        foreach ($jobs as $job) {
            $sql = 'INSERT IGNORE INTO `' . DB_PREPEND . 'phpwcms_profession` (prof_name) VALUES(' . _dbEscape($job) . ')';
            _dbQuery($sql, 'INSERT');
        }
    }
    return $status;
}
Beispiel #2
0
function phpwcms_revision_r529()
{
    $status = true;
    // do former revision check – fallback to r528
    if (phpwcms_revision_check_temp('528') !== true) {
        $status = phpwcms_revision_check('528');
    }
    // reset article and file manager status (open/close)
    _dbUpdate('phpwcms_user', array('usr_var_structure' => '', 'usr_var_publicfile' => '', 'usr_var_privatefile' => ''));
    return $status;
}
Beispiel #3
0
function phpwcms_revision_r497()
{
    $status = true;
    // do former revision check – fallback to r438
    if (phpwcms_revision_check_temp('438') !== true) {
        $status = phpwcms_revision_check('438');
    }
    // Check if seo log hash (for filter unique items) field exists
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_log_seo LIKE 'hash'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_log_seo ADD hash CHAR(32) NOT NULL DEFAULT ''", 'ALTER');
        if ($result) {
            _dbQuery('UPDATE ' . DB_PREPEND . 'phpwcms_log_seo SET hash=MD5(LOWER(CONCAT(domain,query)))', 'UPDATE');
            _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_log_seo ADD INDEX (hash)", 'ALTER');
        }
    }
    // switch crossreference field type from INT to VARCHAR
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_crossreference LIKE 'cref_type'");
    if (isset($result[0]['Type']) && substr(strtolower($result[0]['Type']), 0, 3) == 'int') {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_crossreference CHANGE cref_type cref_type VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        // Update feedimport References
        _dbUpdate('phpwcms_crossreference', array('cref_type' => 'feed_to_article_import'), "cref_str LIKE 'feedimport_%'");
    }
    // add language to article category, article and content part
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_articlecat LIKE 'acat_lang'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecat ADD acat_lang VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecat ADD INDEX (acat_lang)", 'ALTER');
    }
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_article LIKE 'article_lang'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_article ADD article_lang VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_article ADD INDEX (article_lang)", 'ALTER');
    }
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_articlecontent LIKE 'acontent_lang'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecontent ADD acontent_lang VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecontent ADD INDEX (acontent_lang)", 'ALTER');
    }
    return $status;
}
 * @copyright Copyright (c) 2002-2015, Oliver Georgi
 * @license http://opensource.org/licenses/GPL-2.0 GNU GPL-2
 * @link http://www.phpwcms.de
 *
 **/
session_start();
$phpwcms = array();
require_once '../../include/config/conf.inc.php';
require_once '../inc_lib/default.inc.php';
require_once PHPWCMS_ROOT . '/include/inc_lib/dbcon.inc.php';
require_once PHPWCMS_ROOT . '/include/inc_lib/general.inc.php';
checkLogin();
require_once PHPWCMS_ROOT . '/include/inc_lib/backend.functions.inc.php';
if ($_SESSION["wcs_user_admin"] == 1) {
    list($do, $id) = explode('|', $_GET['do']);
    $do = intval($do);
    $id = intval($id);
    if ($id) {
        if ($do === 1) {
            _dbUpdate('phpwcms_pagelayout', array('pagelayout_default' => 0, 'pagelayout_trash' => 9), 'pagelayout_id=' . $id);
        } elseif ($do === 2) {
            $result = _dbUpdate('phpwcms_template', array('template_default' => 0, 'template_trash' => 9), 'template_id=' . $id);
            // Update article categories with new default template ID or to 0 if no default template is defined
            if ($result) {
                $default = _dbGet('phpwcms_template', 'template_id, template_default', 'template_trash=0 AND template_default=1', '', '', 1);
                _dbUpdate('phpwcms_articlecat', array('acat_template' => isset($default[0]['template_id']) ? $default[0]['template_id'] : 0), 'acat_trash=0 AND acat_template=' . $id);
            }
        }
    }
}
headerRedirect($_SESSION['REFERER_URL']);
Beispiel #5
0
             $rrow = $rrow[0];
             $oldFileID = $rrow['f_id'];
             $oldFileHash = $rrow['f_hash'];
             $oldFileNewHash = md5($file_name . microtime() . time());
             // now update new file by old file information of same named
             $nsql = "UPDATE " . DB_PREPEND . "phpwcms_file SET ";
             $nsql .= "f_refid=" . $oldFileID . ", f_trash=5, f_size=" . $rrow['f_size'] . ', ';
             $nsql .= "f_type=" . _dbEscape($rrow['f_type']) . ", f_changed=" . now() . ', ';
             $nsql .= "f_hash=" . _dbEscape($oldFileNewHash) . " WHERE f_id=" . $new_fileId;
             if (_dbQuery($nsql, 'UPDATE')) {
                 // yepp both files are updated in db
                 // now change hash of file storage files
                 rename($useruploadpath . $oldFileHash . $_file_extension, $useruploadpath . $oldFileNewHash . $_file_extension);
                 rename($usernewfile, $useruploadpath . $oldFileHash . $_file_extension);
                 // update file size of old file with new filesize
                 _dbUpdate('phpwcms_file', array('f_type' => $file_type, 'f_size' => $file_size, 'f_changed' => now()), 'f_id=' . $oldFileID);
                 // empty temp images directory
                 $thumbnails = returnFileListAsArray(PHPWCMS_THUMB, 'jpg,jpeg,gif,png');
                 if (is_array($thumbnails) && count($thumbnails)) {
                     foreach ($thumbnails as $thumbnail) {
                         @unlink(PHPWCMS_THUMB . $thumbnail['filename']);
                     }
                 }
             }
         }
     }
     flush();
     echo $file . " [OK!]<br />";
 } else {
     echo $file . " (" . $file_error["upload"] . ")<br />";
     _dbQuery("DELETE FROM " . DB_PREPEND . "phpwcms_file WHERE f_id=" . $new_fileId . " AND f_uid=" . $_SESSION["wcs_user_id"], 'DELETE');
Beispiel #6
0
         }
     }
     if ($content['404error']['status']) {
         // ToDo: maybe Check against structure/article alias and redirect
         $content['404error']['where'] = sprintf('alias LIKE %s', _dbEscape($content['404error']['alias']));
         $content['404error']['alias'] = $content['404error']['redirect_url'];
     }
 } else {
     $content['404error']['where'] = sprintf('id=%d AND aid=%d AND alias LIKE %s', $content['404error']['id'], $content['404error']['aid'], _dbEscape($content['404error']['alias']));
 }
 if ($content['404error']['status']) {
     // does the combination still exists in the database
     $content['404error']['result'] = _dbGet('phpwcms_redirect', '*', $content['404error']['where']);
     if (isset($content['404error']['result'][0])) {
         $content['404error']['result'] = $content['404error']['result'][0];
         _dbUpdate('phpwcms_redirect', array('views' => intval($content['404error']['result']['views']) + 1), 'rid=' . $content['404error']['result']['rid']);
         // Test for redirect
         if ($content['404error']['result']['active'] == 1) {
             // HTTP Status
             // 301, 302 (default), 307, 401, 404, 503
             $content['404error']['result']['code'] = empty($content['404error']['result']['code']) ? 302 : intval($content['404error']['result']['code']);
             // Redirect to Home
             // home (empty), alias, id, aid, link
             if (empty($content['404error']['result']['type'])) {
                 $content['404error']['result']['target'] = getStructureChildEntryHref($content['struct'][0]);
                 $content['404error']['result']['target'] = PHPWCMS_URL . $content['404error']['result']['target']['link'];
                 headerRedirect($content['404error']['result']['target'], $content['404error']['result']['code']);
             } elseif ($content['404error']['result']['target']) {
                 switch ($content['404error']['result']['type']) {
                     case 'alias':
                         $content['404error']['result']['target'] = abs_url(array(), array(), $content['404error']['result']['target'], 'rawurlencode');
function update_404redirect()
{
    $data = array('error' => array(), 'data' => array('rid' => intval($_POST['rid']), 'alias' => clean_slweg($_POST['alias']), 'id' => trim($_POST['id']) === '' ? '' : intval($_POST['id']), 'aid' => trim($_POST['aid']) === '' || !intval($_POST['aid']) ? '' : intval($_POST['aid']), 'type' => empty($_POST['type']) || !in_array($_POST['type'], array('alias', 'id', 'aid', 'link')) ? '' : clean_slweg($_POST['type']), 'active' => empty($_POST['active']) ? 0 : 1, 'shortcut' => empty($_POST['shortcut']) ? 0 : 1, 'code' => empty($_POST['code']) || !in_array($_POST['code'], array('301', '307', '404', '401', '503')) ? '' : clean_slweg($_POST['code']), 'target' => clean_slweg($_POST['target']), 'changed' => date('Y-m-d H:i:s')));
    if (!$data['data']['aid'] && !$data['data']['alias'] && $data['data']['id'] == '' && !isset($_POST['delete_' . md5($data['data']['rid'])])) {
        $data['error'][] = $GLOBALS['BL']['be_redirect_error1'];
    }
    if ($data['data']['type'] && $data['data']['target'] === '') {
        $data['error'][] = $GLOBALS['BL']['be_redirect_error2'];
    } elseif (($data['data']['type'] == 'id' || $data['data']['type'] == 'aid') && !is_intval($data['data']['target'])) {
        $data['error'][] = $GLOBALS['BL']['be_redirect_error3'];
    }
    if (count($data['error'])) {
        $data['data']['active'] = 0;
        set_status_message(implode('<br />', $data['error']), 'error');
    } else {
        $data['error'] = NULL;
        $rid = $data['data']['rid'];
        unset($data['data']['rid']);
        if ($rid) {
            // Mark for deletion
            if (isset($_POST['delete_' . md5($rid)])) {
                $data['data']['active'] = 9;
                $result = _dbQuery('DELETE FROM ' . DB_PREPEND . 'phpwcms_redirect WHERE rid=' . $rid, 'DELETE');
            } else {
                $result = _dbUpdate('phpwcms_redirect', $data['data'], 'rid=' . $rid);
            }
        } else {
            $result = _dbInsert('phpwcms_redirect', $data['data']);
            if (isset($result['INSERT_ID'])) {
                $rid = $result['INSERT_ID'];
            }
        }
        $data['data']['rid'] = $rid;
        if ($result) {
            if ($data['data']['active'] == 9) {
                set_status_message(str_replace('{ID}', $data['data']['rid'], $GLOBALS['BL']['be_action_deleted']), 'success');
                headerRedirect('phpwcms.php?' . get_token_get_string('csrftoken') . '&do=admin&p=14');
            } else {
                set_status_message($GLOBALS['BL']['be_successfully_saved'], 'success');
            }
        } else {
            set_status_message($GLOBALS['BL']['be_error_while_save'], 'error');
        }
    }
    return $data;
}
Beispiel #8
0
 *
 **/
session_start();
$phpwcms = array();
require_once '../../include/config/conf.inc.php';
require_once '../inc_lib/default.inc.php';
require_once PHPWCMS_ROOT . '/include/inc_lib/dbcon.inc.php';
require_once PHPWCMS_ROOT . '/include/inc_lib/general.inc.php';
checkLogin();
require_once PHPWCMS_ROOT . '/include/inc_lib/backend.functions.inc.php';
if ($_SESSION["wcs_user_admin"] == 1) {
    //If user has admin rights
    // enym
    if (isset($_GET["del"])) {
        $gi = explode(":", clean_slweg($_GET["del"]));
        $gi = intval($gi[0]);
        if ($gi) {
            _dbUpdate('phpwcms_usergroup', array('group_active' => 9), 'group_id=' . $gi);
        }
    }
    if (isset($_GET["aktiv"])) {
        $gi = explode(":", clean_slweg($_GET["aktiv"]));
        $gi[0] = intval($gi[0]);
        $gi[1] = empty($gi[1]) ? 0 : 1;
        if ($gi[0]) {
            _dbUpdate('phpwcms_usergroup', array('group_active' => $gi[1]), 'group_id=' . $gi[0]);
        }
    }
}
//End action
headerRedirect($_SESSION['REFERER_URL']);
    } else {
        $sendbutton = $BL['be_admin_fcat_button2'];
        //create group
    }
    if (!empty($_POST["group_aktion"])) {
        $group["id"] = intval($_POST["group_id"]);
        $group["name"] = clean_slweg($_POST["group_name"], 250);
        $group["member"] = isset($_POST["acat_access"]) && is_array($_POST["acat_access"]) ? implode(',', $_POST["acat_access"]) : '';
        $group["value"] = clean_slweg($_POST["group_value"]);
        $group["trash"] = empty($_POST["group_trash"]) ? 0 : intval($_POST["group_trash"]);
        $group["active"] = empty($_POST["group_active"]) ? 0 : 1;
        if (empty($group["name"])) {
            $group["error"] = 1;
        } else {
            $data = array('group_name' => $group["name"], 'group_member' => $group["member"], 'group_value' => $group["value"], 'group_trash' => $group["trash"], 'group_active' => $group["active"]);
            $result = $group["id"] ? _dbUpdate('phpwcms_usergroup', $data, 'group_id=' . $group["id"]) : _dbInsert('phpwcms_usergroup', $data);
            if (isset($result['AFFECTED_ROWS']) || isset($result['INSERT_ID'])) {
                headerRedirect(PHPWCMS_URL . 'phpwcms.php?' . get_token_get_string('csrftoken') . '&do=admin&p=1');
            } else {
                echo mysql_error();
            }
        }
        $group["member"] = convertStringToArray($group["member"]);
    }
    ?>



		  <form action="phpwcms.php?do=admin&amp;p=1&amp;create_group=1" method="post" name="editsitestructure" id="editsitestructure" onsubmit="selectAllOptions(this.acat_access);selectAllOptions(this.acat_cp);var x = wordcount(this.acat_name.value);if(x&lt;1) {alert('Fill in a category title! \n\n('+x+' words total)');this.acat_name.focus();return false;}">
		  <tr align="center" bgcolor="#F0F2F4"><td colspan="2"><table border="0" cellpadding="0" cellspacing="0" summary="">
		  	<?php 
 * @author Oliver Georgi <*****@*****.**>
 * @copyright Copyright (c) 2002-2015, Oliver Georgi
 * @license http://opensource.org/licenses/GPL-2.0 GNU GPL-2
 * @link http://www.phpwcms.de
 *
 **/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
if (isset($_POST['rid']) && !isset($_POST['donotsubmit'])) {
    $data_result = update_404redirect();
} elseif (isset($_GET['rid']) && intval($_GET['rid']) && isset($_GET['active'])) {
    _dbUpdate('phpwcms_redirect', array('active' => empty($_GET['active']) ? 1 : 0), 'rid=' . intval($_GET['rid']));
} else {
    $data_result = array('error' => NULL, 'data' => array());
}
// List Redirects
if (!isset($_GET['rid']) || isset($_GET['active'])) {
    $_entry = array('query' => '');
    // Pagination
    if (isset($_GET['c'])) {
        $_SESSION['redirect_list_count'] = $_GET['c'] == 'all' ? '99999' : intval($_GET['c']);
    }
    if (isset($_GET['page'])) {
        $_SESSION['redirect_detail_page'] = intval($_GET['page']);
    }
    // set default values for paginating
    if (empty($_SESSION['redirect_list_count'])) {
Beispiel #11
0
             $data[$key[0]][$key[1]] = $val;
         } else {
             $data[$key[0]] = $val;
         }
         if (is_array($data[$key[0]]) || is_object($data[$key[0]])) {
             $data_serialize[$key[0]] = $key[0];
         }
     }
     if (count($data_serialize)) {
         foreach ($data_serialize as $value) {
             $data[$value] = serialize($data[$value]);
         }
     }
     if ($plugin['data']['id']) {
         // UPDATE
         $result = _dbUpdate('phpwcms_content', $data, 'cnt_id=' . $plugin['data']['id'] . ' AND cnt_module=' . _dbEscape(MODULE_KEY));
     } else {
         // INSERT
         $data['cnt_created'] = now();
         $result = _dbInsert('phpwcms_content', $data);
     }
     // Back to module listing
     if (isset($_POST['save'])) {
         headerRedirect(MODULE_HREF_DECODE);
     }
     // set ID
     if (!empty($result['INSERT_ID'])) {
         $plugin['data']['id'] = $result['INSERT_ID'];
         $plugin['id'] = $result['INSERT_ID'];
     }
 } else {
Beispiel #12
0
 function edit()
 {
     $this->newsId = intval($_GET['cntid']);
     $this->data = array();
     if (isset($_GET['status'])) {
         $status = intval($_GET['status']);
         switch ($status) {
             case 0:
             case 1:
             case 9:
                 _dbUpdate('phpwcms_content', array('cnt_status' => $status), 'cnt_id=' . $this->newsId);
                 set_status_message($status == 9 ? $this->BL['be_action_deleted'] : $this->BL['be_action_status'], 'success', array('ID' => $this->newsId));
                 break;
             default:
                 set_status_message($this->BL['be_action_notvalid'], 'warning');
         }
         headerRedirect($this->base_url_decoded);
     }
     $start_date = 0;
     $end_date = 0;
     $this->data = array('cnt_id' => 0, 'cnt_pid' => 0, 'cnt_status' => intval($this->phpwcms['set_news_active']), 'cnt_livedate' => '0000-00-00 00:00:00', 'cnt_killdate' => '0000-00-00 00:00:00', 'cnt_archive_status' => 1, 'cnt_alias' => '', 'cnt_name' => '', 'cnt_title' => '', 'cnt_subtitle' => '', 'cnt_editor' => '', 'cnt_place' => '', 'cnt_teasertext' => '', 'cnt_text' => '', 'cnt_duplicate' => 0, 'cnt_lang' => '', 'cnt_prio' => 0, 'cnt_readmore' => 1, 'cnt_image' => array('id' => 0, 'name' => '', 'zoom' => 0, 'lightbox' => 0, 'caption' => '', 'link' => ''), 'cnt_files' => array('id' => array(), 'caption' => '', 'gallery' => 0, 'gallery_download' => 0), 'cnt_link' => '', 'cnt_linktext' => '', 'cnt_category' => '', 'cnt_livedate' => '', 'cnt_killdate' => '', 'cnt_sort' => 0, 'cnt_opengraph' => empty($this->phpwcms['set_sociallink']['news']) ? 0 : 1, 'cnt_textformat' => 'plain', 'cnt_searchoff' => 0);
     // check form post
     if (isset($_POST['cnt_name'])) {
         $post = $this->getPostData();
         $post_error = false;
         if (!empty($_POST['cnt_duplicate'])) {
             $this->newsId = 0;
             $duplicate = 1;
             $post['cnt_created'] = now();
         } else {
             $duplicate = 0;
         }
         // 1st check if we have a name because it's mandatory
         if ($post['cnt_name'] == '') {
             $post_error = true;
             set_status_message($this->BL['be_news_name_mandatory'], 'warning');
             $post['cnt_duplicate'] = $duplicate;
         }
         // do db work
         if ($post_error === false) {
             $values = $post;
             $values['cnt_object'] = serialize($values['cnt_object']);
             $success = false;
             // store new dataset
             if ($this->newsId == 0) {
                 $result = _dbInsert('phpwcms_content', $values);
                 if (isset($result['INSERT_ID'])) {
                     $this->newsId = $result['INSERT_ID'];
                     $success = true;
                     set_status_message($this->BL['be_successfully_saved'] . LF . $post['cnt_name'], 'success');
                 }
                 // update existing dataset
             } else {
                 $result = _dbUpdate('phpwcms_content', $values, 'cnt_id=' . $this->newsId);
                 if ($result != false) {
                     $success = true;
                     set_status_message($this->BL['be_successfully_updated'] . LF . $post['cnt_name'], 'success');
                 }
             }
             // if success
             if ($success) {
                 // save categories
                 if ($this->newsId) {
                     _dbSaveCategories($post['cnt_object']['cnt_category'], 'news', $this->newsId, ',');
                 }
                 // redirect to form again
                 if ($this->newsId && isset($_POST['submit'])) {
                     headerRedirect($this->base_url_decoded . '&cntid=' . $this->newsId . '&action=edit');
                     // back to listing
                 } else {
                     headerRedirect($this->base_url_decoded);
                 }
                 // error while storing data
             } else {
                 set_status_message($BL['be_error_while_save'] . trim(html(' ' . mysql_errno() . ': ' . mysql_error())), 'warning');
             }
         }
         $this->data = array_merge($this->data, $post);
     } elseif ($this->newsId > 0) {
         $result = _dbGet('phpwcms_content', '*', 'cnt_status!=9 AND cnt_id=' . $this->newsId, '', '', '1');
         if (isset($result[0])) {
             $result[0]['cnt_object'] = @unserialize($result[0]['cnt_object']);
             if (is_array($result[0]['cnt_object']['cnt_image'])) {
                 $result[0]['cnt_image'] = array_merge($this->data['cnt_image'], $result[0]['cnt_object']['cnt_image']);
             }
             if (is_array($result[0]['cnt_object']['cnt_files'])) {
                 $result[0]['cnt_files'] = array_merge($this->data['cnt_files'], $result[0]['cnt_object']['cnt_files']);
             }
             if (isset($result[0]['cnt_object']['cnt_link'])) {
                 $result[0]['cnt_link'] = $result[0]['cnt_object']['cnt_link'];
             }
             if (isset($result[0]['cnt_object']['cnt_linktext'])) {
                 $result[0]['cnt_linktext'] = $result[0]['cnt_object']['cnt_linktext'];
             }
             if (isset($result[0]['cnt_object']['cnt_category'])) {
                 $result[0]['cnt_category'] = $result[0]['cnt_object']['cnt_category'];
             }
             if (isset($result[0]['cnt_object']['cnt_readmore'])) {
                 $result[0]['cnt_readmore'] = $result[0]['cnt_object']['cnt_readmore'];
             }
             if (isset($result[0]['cnt_object']['cnt_textformat'])) {
                 $result[0]['cnt_textformat'] = $result[0]['cnt_object']['cnt_textformat'];
             }
             if (isset($result[0]['cnt_object']['cnt_searchoff'])) {
                 $result[0]['cnt_searchoff'] = $result[0]['cnt_object']['cnt_searchoff'];
             }
             $this->data = array_merge($this->data, $result[0]);
         } else {
             set_status_message($this->BL['be_data_select_failed'], 'warning');
             headerRedirect($this->base_url_decoded);
         }
     }
     $start_date = strtotime($this->data['cnt_livedate']);
     $end_date = strtotime($this->data['cnt_killdate']);
     $sort_date = intval($this->data['cnt_sort']);
     if ($start_date <= 0) {
         $this->data['cnt_livedate'] = '0000-00-00 00:00:00';
         $this->data['cnt_date_start'] = '';
         $this->data['cnt_time_start'] = '';
     } else {
         $this->data['cnt_date_start'] = date($this->BL['default_date'], $start_date);
         $this->data['cnt_time_start'] = date($this->BL['default_time'], $start_date);
     }
     if ($end_date <= 0) {
         $this->data['cnt_killdate'] = '0000-00-00 00:00:00';
         $this->data['cnt_date_end'] = '';
         $this->data['cnt_time_end'] = '';
     } else {
         $this->data['cnt_date_end'] = date($this->BL['default_date'], $end_date);
         $this->data['cnt_time_end'] = date($this->BL['default_time'], $end_date);
     }
     // sort date
     if ($sort_date <= 0) {
         $this->data['cnt_sort'] = 0;
         $this->data['cnt_sort_date'] = '';
         $this->data['cnt_sort_time'] = '';
     } else {
         $this->data['cnt_sort_date'] = date($this->BL['default_date'], $sort_date);
         $this->data['cnt_sort_time'] = date($this->BL['default_time'], $sort_date);
     }
 }
         $sql .= "detail_login="******" LIMIT 1";
         $result = _dbQuery($sql);
         if (isset($result[0])) {
             $result[0]['PASSWORD'] = generic_string(8);
             _dbUpdate('phpwcms_userdetail', array('detail_password' => md5($result[0]['PASSWORD'])), 'WHERE detail_id=' . $result[0]['detail_id']);
             $_loginData['remind_password'] = $result[0];
         }
     }
     // hm, seems no user found - OK test against cms users
     if ($_loginData['validate_db']['backenduser'] && !isset($result[0])) {
         $sql = 'SELECT usr_id, usr_login AS LOGIN, usr_email AS EMAIL FROM ' . DB_PREPEND . 'phpwcms_user WHERE ';
         $sql .= "usr_login="******" LIMIT 1";
         $result = _dbQuery($sql);
         if (isset($result[0])) {
             $result[0]['PASSWORD'] = generic_string(8);
             _dbUpdate('phpwcms_user', array('usr_pass' => md5($result[0]['PASSWORD'])), 'WHERE usr_id=' . $result[0]['usr_id']);
             $_loginData['remind_password'] = $result[0];
         }
     }
 }
 if (isset($_loginData['remind_password']) || isset($_loginData['remind_login'])) {
     $_loginData['reminder'] = $_loginData['reminder_success'];
     $_loginData['LOGIN_URL'] = rel_url(array(), array('profile_manage', 'profile_register', 'profile_reminder'));
     $_loginData['reminder_email'] = str_replace('{LOGIN_URL}', PHPWCMS_URL . $_loginData['LOGIN_URL'], $_loginData['reminder_email']);
     if (isset($_loginData['remind_password'])) {
         $_loginData['reminder_email'] = str_replace('{LOGIN}', $_loginData['remind_password']['LOGIN'], $_loginData['reminder_email']);
         $_loginData['reminder_email'] = str_replace('{PASSWORD}', $_loginData['remind_password']['PASSWORD'], $_loginData['reminder_email']);
         $_loginData['reminder_to'] = $_loginData['remind_password']['EMAIL'];
         $_loginData['reminder_email_body'] = returnTagContent($_loginData['reminder_email'], 'PASSWORD_EMAIL');
         $_loginData['reminder_email_body'] = $_loginData['reminder_email_body']['tag'];
     } else {
// first check if neccessary db exists
if (isset($phpwcms['modules'][$module]['path'])) {
    // module default stuff
    // put translation back to have easier access to it - use it as relation
    $BLM =& $BL['modules'][$module];
    define('MODULE_HREF', 'phpwcms.php?' . get_token_get_string('csrftoken') . '&amp;do=modules&amp;module=' . $module);
    define('MODULE_HREF_DECODE', PHPWCMS_URL . 'phpwcms.php?' . get_token_get_string('csrftoken') . '&do=modules&module=' . $module);
    define('MODULE_KEY', 'feedimport');
    require_once $phpwcms['modules'][$module]['path'] . 'inc/functions.inc.php';
    if (isset($_GET['edit'])) {
        include_once PHPWCMS_ROOT . '/include/inc_lib/article.functions.inc.php';
        //load article funtions
        // handle posts and read data
        include_once $phpwcms['modules'][$module]['path'] . 'inc/processing.inc.php';
        // edit form
        include_once $phpwcms['modules'][$module]['path'] . 'backend.editform.php';
    } elseif (isset($_GET['active']) && !empty($_GET['editid'])) {
        // active/inactive
        $data = array('cnt_changed' => now(), 'cnt_status' => empty($_GET['active']) ? 0 : 1);
        _dbUpdate('phpwcms_content', $data, 'cnt_id=' . intval($_GET['editid']) . ' AND cnt_module=' . _dbEscape(MODULE_KEY));
        headerRedirect(MODULE_HREF_DECODE);
    } elseif (!empty($_GET['delete'])) {
        // delete
        $data = array('cnt_changed' => now(), 'cnt_status' => 9);
        _dbUpdate('phpwcms_content', $data, 'cnt_id=' . intval($_GET['delete']) . ' AND cnt_module=' . _dbEscape(MODULE_KEY));
        headerRedirect(MODULE_HREF_DECODE);
    } else {
        // listing
        include_once $phpwcms['modules'][$module]['path'] . 'backend.listing.php';
    }
}