Esempio n. 1
0
function clients_new_client($cid, $project_name, $newdesc, $newpath, $newurl, $with_dir, $newlang, $newlangdesc, $charset)
{
    global $db, $cms_db, $auth, $cfg_cms, $perm;
    global $errno, $user_msg;
    //Globals die f�r Neue Sprache anlegen gebraucht werden
    global $sess, $lang;
    $project_name = empty($project_name) ? 'Neues Projekt' : $project_name;
    include_once 'Archive/Tar.php';
    $tar = new Archive_Tar($cfg_cms['path_base'] . $cfg_cms['path_backend_rel'] . 'tpl/projektvorlage.tar');
    if ($with_dir == 1) {
        umask(00);
        $chmod_value = intval($cfg_cms['chmod_value'], 8);
        if (@(!mkdir($cfg_cms['path_base'] . $newpath, $chmod_value))) {
            $errno = 'cant_make_path';
            return;
        }
        if (!$tar->extract($cfg_cms['path_base'] . $newpath)) {
            $errno = 'cant_extract_tar';
            return;
        }
    }
    // SQL Eintraege
    $sql_array = file($cfg_cms['path_base'] . $cfg_cms['path_backend_rel'] . 'tpl/projektvorlage.sql');
    $project_path_relative = str_replace($cfg_cms['path_base_http'], '', $newpath);
    $project_http_path_absolute = str_replace($project_path_relative, '', $newurl);
    foreach ($sql_array as $sql) {
        if (substr($sql, 0) == '#' || trim($sql) == '') {
            continue;
        }
        if (!empty($sql)) {
            $sql = substr(chop($sql), 0, -1);
            $sql = str_replace("<!--{db_prefix}-->", $cfg_cms['db_table_prefix'], $sql);
            $sql = str_replace("<!--{client_path_relative}-->", $project_path_relative, $sql);
            $sql = str_replace("<!--{base_http_path_absolute}-->", $project_http_path_absolute, $sql);
            $sql = str_replace("<!--{idclient}-->", $cid, $sql);
            $sql = str_replace("<!--{projectname}-->", $project_name, $sql);
            $sql = str_replace("<!--{projectdesc}-->", $newdesc, $sql);
            $sql = str_replace("<!--{userid}-->", $auth->auth['uid'], $sql);
            $sql = str_replace("<!--{time}-->", time(), $sql);
            $db->query($sql);
        }
    }
    //neue rechte einf�gen f�r client
    $perm->xcopy_perm(0, 'area_clients', $cid, 'clients', 4294967295.0, 0, 0, true);
    // make new userright
    //Neue Sprache anlegen
    $newlang = empty($newlang) ? 'Neue Sprache' : $newlang;
    $errno = lang_new_language($cid, $newlang, $newlangdesc, $charset, '', 'standard', false);
    $sql = "SELECT MAX(idlang) AS max FROM " . $cms_db['lang'];
    $db->query($sql);
    $db->next_record();
    $nextlang = $db->f('max');
    //set new lang as startlang
    lang_make_start_lang($cid, $nextlang);
    // Config schreiben
    if ($with_dir == 1) {
        $fh = fopen($cfg_cms['path_base'] . $newpath . "/cms/inc/config.php", "w");
        fwrite($fh, "<?php\n\t\$cms_path = '../" . $cfg_cms['path_backend_rel'] . "';\n\t\$client = '{$cid}';\n\t\t\n\t// options for logger in client\n\t\$cfg_client['log_path']\t\t\t\t= 'logs/errorlog.txt';\n\t\$cfg_client['log_size']\t\t\t\t= 2097152; //2097152 = 2 MB\n\t\$cfg_client['logfile_mailaddress']\t= '';\n\n\t// display errors if no logger available\n\t\$cfg_client['display_errors']\t= 1;\n\t\t\n\t// overwrite the default error_reporting for client\n\t//\$error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED;\n\t\n\t\n\t// overwrite value display_errors set ini_set for frontend\n\tif(\$cfg_client['display_errors'] == 0 || \$cfg_client['display_errors'] == 1) {\n\t\tini_set('display_errors', \$cfg_client['display_errors']);\n\t}\n?" . ">\n");
        fclose($fh);
    }
    //neue rechte einf�gen f�r sprache
    $perm->xcopy_perm($cid, 'clients', $nextlang, 'clientlangs', 4294901760.0, 0, 0, true);
    //langstring for new client success userinfo
    $user_msg = 'success_new_client';
}
Esempio n. 2
0
        $perm->check(18, 'clients', $collapse);
        $errno = lang_new_language($collapse, $newname, $newdesc, $charset, $_REQUEST['rewrite_key'], $_REQUEST['rewrite_mapping']);
        break;
    case 'save_edited_lang':
        // Sprache umbenennen
        $perm->check(19, 'clientlangs', $idlang);
        $errno = lang_rename_language($idlang, $newname, $newdesc, $charset, $_REQUEST['rewrite_key'], $_REQUEST['rewrite_mapping']);
        break;
    case 'delete_lang':
        // Sprache löschen
        //collapse ist idclient
        $perm->check(21, 'clientlangs', $idlang);
        $errno = lang_delete_language($collapse, $lid);
        break;
    case 'makestartlang':
        $errno = lang_make_start_lang((int) $_REQUEST['cid'], (int) $_REQUEST['lid']);
        break;
}
/******************************************************************************
 3. Eventuelle Dateien zur Darstellung includieren
******************************************************************************/
/******************************************************************************
 4. Bildschirmausgabe aufbereiten und ausgeben
******************************************************************************/
//
// GENERAL VALUES
//
$c_conf['url'] = $sess->url('main.php?area=' . $area);
$c_conf['url_extern'] = $sess->url('main.php?collapse=' . $collapse);
$c_conf['image_path'] = 'tpl/' . $cfg_cms['skin'] . '/img/';
$c_conf['style_project'] = '#f7fbff';
Esempio n. 3
0
function clients_new_client($cid, $project_name, $newdesc, $newpath, $newurl, $with_dir, $newlang, $newlangdesc, $charset)
{
    global $db, $cms_db, $auth, $cfg_cms, $perm;
    global $errno, $user_msg;
    //Globals die für Neue Sprache anlegen gebraucht werden
    global $sess, $lang;
    $project_name = empty($project_name) ? 'Neues Projekt' : $project_name;
    include_once 'Archive/Tar.php';
    $tar = new Archive_Tar($cfg_cms['cms_path'] . 'tpl/projektvorlage.tar');
    if ($with_dir == 1) {
        umask(00);
        $chmod_value = intval($cfg_cms['chmod_value'], 8);
        if (@(!mkdir($newpath, $chmod_value))) {
            $errno = 'cant_make_path';
            return;
        }
        if (!$tar->extract($newpath)) {
            $errno = 'cant_extract_tar';
            return;
        }
    }
    // SQL Einträge
    $sql_array = file($cfg_cms['cms_path'] . 'tpl/projektvorlage.sql');
    foreach ($sql_array as $sql) {
        if (!empty($sql)) {
            $sql = substr(chop($sql), 0, -1);
            $sql = str_replace("<!--{db_prefix}-->", $cfg_cms['db_table_prefix'], $sql);
            $sql = str_replace("<!--{cms_path}-->", $newpath, $sql);
            $sql = str_replace("<!--{cms_full_http_path}-->", $newurl, $sql);
            $sql = str_replace("<!--{idclient}-->", $cid, $sql);
            $sql = str_replace("<!--{projectname}-->", $project_name, $sql);
            $sql = str_replace("<!--{projectdesc}-->", $newdesc, $sql);
            $sql = str_replace("<!--{userid}-->", $auth->auth['uid'], $sql);
            $sql = str_replace("<!--{time}-->", time(), $sql);
            $db->query($sql);
        }
    }
    //neue rechte einfügen für client
    $perm->xcopy_perm(0, 'area_clients', $cid, 'clients', 4294967295.0, 0, 0, true);
    // make new userright
    //Neue Sprache anlegen
    $newlang = empty($newlang) ? 'Neue Sprache' : $newlang;
    $errno = lang_new_language($cid, $newlang, $newlangdesc, $charset, '', 'standard', false);
    $sql = "SELECT MAX(idlang) AS max FROM " . $cms_db['lang'];
    $db->query($sql);
    $db->next_record();
    $nextlang = $db->f('max');
    //set new lang as startlang
    lang_make_start_lang($cid, $nextlang);
    // Config schreiben
    if ($with_dir == 1) {
        $fh = fopen($newpath . "/cms/inc/config.php", "w");
        fwrite($fh, "<?PHP\n\$cms_path = '../backend/';\n\$client = '{$cid}';\n\n?" . ">\n");
        fclose($fh);
    }
    //neue rechte einfügen für sprache
    $perm->xcopy_perm($cid, 'clients', $nextlang, 'clientlangs', 4294901760.0, 0, 0, true);
    //langstring for new client success userinfo
    $user_msg = 'success_new_client';
}