Ejemplo n.º 1
0
function insert($table = NULL)
{
    if (!$table) {
        $table = $GLOBALS['table'];
    }
    db_insert($table, fields($table), values($table));
    $_REQUEST['id'] = db_get_value($table, 'LAST_INSERT_ID()');
}
Ejemplo n.º 2
0
 function delCourse($id)
 {
     $ugroup_id = db_get_value("class", "FK_ugroup", "class_id='" . addslashes($id) . "'");
     $query = "\n\t\t\tDELETE FROM\n\t\t\t\tclass\n\t\t\tWHERE\n\t\t\t\tclass_id='" . addslashes($id) . "'\n\t\t";
     db_query($query);
     $query = "\n\t\t\tDELETE FROM\n\t\t\t\tugroup_user\n\t\t\tWHERE\n\t\t\t\tFK_ugroup='" . addslashes($ugroup_id) . "'\n\t\t";
     db_query($query);
     $query = "\n\t\t\tDELETE FROM\n\t\t\t\tugroup\n\t\t\tWHERE\n\t\t\t\tugroup_id='" . addslashes($ugroup_id) . "'\n\t\t";
     db_query($query);
 }
Ejemplo n.º 3
0
 function showRawPrint($subaction = null)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $parent = $this->getParentO();
     $v = lfile_get_contents("htmllib/filecore/sshterm-applet.htm");
     if ($parent->is__table('pserver')) {
         $v = str_replace("%username%", "root", $v);
         $ip = getFQDNforServer($parent->nname);
         $sshport = db_get_value("sshconfig", $parent->nname, "ssh_port");
         if (!$sshport) {
             $sshport = "22";
         }
         $v = str_replace("%host%", $ip, $v);
         $v = str_replace("%port%", $sshport, $v);
         $v = str_replace("%connectimmediately%", "true", $v);
     } else {
         if ($parent->is__table('client')) {
             if ($parent->isDisabled('shell') || !$parent->shell) {
                 $ghtml->print_information("pre", "updateform", "sshclient", "disabled");
                 exit;
             }
             $sshport = db_get_value("sshconfig", $parent->websyncserver, "ssh_port");
             if (!$sshport) {
                 $sshport = "22";
             }
             $ghtml->print_information("pre", "updateform", "sshclient", "warning");
             $ip = getFQDNforServer("localhost");
             $v = str_replace("%username%", $parent->username, $v);
             $v = str_replace("%host%", $ip, $v);
             $v = str_replace("%port%", $sshport, $v);
             $v = str_replace("%connectimmediately%", "true", $v);
         } else {
             $v = str_replace("%username%", "root", $v);
             $ip = $parent->getOneIP();
             $sshport = db_get_value("sshconfig", $parent->syncserver, "ssh_port");
             if (!$ip) {
                 throw new lxException("need_to_add_at_least_one_ip_to_the_vps_for_logging_in");
             }
             if (!$sshport) {
                 $sshport = "22";
             }
             $v = str_replace("%host%", $ip, $v);
             $v = str_replace("%port%", $sshport, $v);
             $v = str_replace("%connectimmediately%", "true", $v);
         }
     }
     print $v;
 }
Ejemplo n.º 4
0
function serverCopySite($orig, $dest)
{
    $sections = decode_array(db_get_value("sites", "sections", "name='{$orig}'"));
    $nsections = array();
    foreach ($sections as $s) {
        $sa = db_get_line("sections", "id={$s}");
        $squery = "insert into sections set addedby='" . addslashes($_SESSION['auser']) . "', addedtimestamp=NOW()";
        $squery .= ",title='{$sa['title']}', active={$sa['active']}, type='{$sa['type']}', url='{$sa['url']}'";
        $pages = decode_array($sa[pages]);
        $npages = array();
        foreach ($pages as $p) {
            $pa = db_get_line("pages", "id={$p}");
            $pquery = "insert into pages set addedby='" . addslashes($_SESSION['auser']) . "', addedtimestamp=NOW()";
            $pquery .= ",ediscussion=1,archiveby='{$pa['archiveby']}',url='{$pa['url']}',type='{$pa['type']}',title='{$pa['title']}', showcreator={$pa['showcreator']}, showdate={$pa['showdate']}, locked={$pa['locked']}, active={$pa['active']}";
            $stories = decode_array($pa[stories]);
            $nstories = array();
            foreach ($stories as $st) {
                $sta = db_get_line("stories", "id={$st}");
                $stquery = "insert into stories set addedby='" . addslashes($_SESSION['auser']) . "', addedtimestamp=NOW()";
                $stquery .= ",type='{$sta['type']}',texttype='{$sta['texttype']}',category='{$sta['category']}',title='{$sta['title']}', discuss={$sta['discuss']}, discusspermissions='{$sta['discusspermissions']}', shorttext='{$sta['shorttext']}', longertext='{$sta['longertext']}', locked={$sta['locked']}, url='{$sa['url']}'";
                db_query($stquery);
                //				print "$stquery<br />";
                $nstories[] = lastid();
            }
            $stories = encode_array($nstories);
            $pquery .= ",stories='{$stories}'";
            db_query($pquery);
            $npages[] = lastid();
            //			print "$pquery<br />";
        }
        $pages = encode_array($npages);
        $squery .= ",pages='{$pages}'";
        db_query($squery);
        $nsections[] = lastid();
        //		print "$squery<br />";
    }
    $sections = encode_array($nsections);
    $query = "update sites set sections='{$sections}' where name='{$dest}'";
    db_query($query);
    //	print "$query<br />";
}
Ejemplo n.º 5
0
 function showRawPrint($subaction = null)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $parent = $this->getParentO();
     $parent->makeSureTheUserExists();
     $lgg = $parent->getLogin();
     $sshport = db_get_value("sshconfig", $parent->syncserver, "ssh_port");
     if (!$sshport) {
         $sshport = "22";
     }
     $v = lfile_get_contents("htmllib/filecore/sshterm-applet.htm");
     $ip = $lgg[1];
     $v = str_replace("%username%", $lgg[0], $v);
     $v = str_replace("%host%", $ip, $v);
     $v = str_replace("%port%", $sshport, $v);
     $v = str_replace("%connectimmediately%", "true", $v);
     $string = $login->getKeyword("console_message");
     $string = str_replace("%username%", "<font style='font-weight:bold'>{$lgg['0']}@{$ip}:{$sshport} </font>", $string);
     print " <table cellpadding=0 cellspacing=0 width=80%> <tr> <td > {$string} <br> </td> </tr> </table>  \n";
     print $v;
 }
Ejemplo n.º 6
0
function tile_get_32($url)
{
    $tile = db_get_value('tiles', 't32', 'where url=%"', $url);
    if ($tile === false) {
        #return false;
        return str_repeat("", 32 * 32 / 8);
    }
    #$debug_binary = true;
    if ($debug_binary) {
        $GLOBALS['debug_tiles'] = true;
        tile_get_128($url);
        # because it prints now
        tile_get_64($url);
        # because it prints now
        print_full_table($tile, 32, 32 / 8);
        exit;
    }
    if ($GLOBALS['debug_tiles']) {
        print_full_table($tile, 32, 32 / 8);
    }
    return $tile;
}
Ejemplo n.º 7
0
 function getAnyErrorMessage()
 {
     global $gbl, $sgbl, $login, $ghtml;
     if ($sgbl->isKloxo() && $this->isAdmin()) {
         if (!is_unlimited($this->priv->maindomain_num) && $this->priv->maindomain_num - $this->used->maindomain_num < 6) {
             $ghtml->__http_vars['frm_smessage'] = 'warn_license_limit';
             $ghtml->__http_vars['frm_m_smessage_data'] = 'maindomain_num';
         }
     }
     if ($this->isAdmin()) {
         $v = db_get_value("sshconfig", "localhost", "without_password_flag");
         $vv = db_get_value("sshconfig", "localhost", "config_flag");
         $this->__t_check_var = $v;
         $this->__t_check_vvar = $vv;
         if (!$this->isOn('__t_check_var') && !$this->isOn('__t_check_vvar')) {
             //$ghtml->__http_vars['frm_emessage'] = "ssh_root_password_access";
         }
         if ($sgbl->isKloxo()) {
             $v = db_get_value("servermail", "localhost", "myname");
             if ($sgbl->isKloxo() && !$v) {
                 $ghtml->__http_vars['frm_emessage'] = "mail_server_name_not_set";
             }
         }
         if (!$gbl->getSessionV('__v_error_not_first_time')) {
             $v = db_get_value("lxguard", "localhost", "configure_flag");
             $this->__t_check_var = $v;
             if (!$this->isOn('__t_check_var')) {
                 $ghtml->__http_vars['frm_emessage'] = "lxguard_not_configured";
             }
         }
     }
     parent::getAnyErrorMessage();
     $gbl->setSessionV('__v_error_not_first_time', 1);
 }
Ejemplo n.º 8
0
function get_story_title($story_id)
{
    $story_title = db_get_value("story", "story_title", "story_id ='" . addslashes($story_id) . "'");
    return $story_title;
}
Ejemplo n.º 9
0
function doUpdateExtraStuff()
{
    global $gbl, $sgbl, $login, $ghtml;
    lxfile_mkdir("__path_program_etc/flag");
    print "Check database password\n";
    $a = null;
    fix_mysql_root_password('localhost');
    $dbadmin = new Dbadmin(null, 'localhost', "mysql___localhost");
    $dbadmin->get();
    $pass = $dbadmin->dbpassword;
    $a['mysql']['dbpassword'] = $pass;
    slave_save_db("dbadmin", $a);
    print "Check the core database\n";
    parse_sql_data();
    if (call_with_flag("convertIpaddressToComa")) {
        print "Converted IP addresses in database\n";
    }
    if (call_with_flag("fixExtraDB")) {
        print "- Fixed\n";
    }
    print "Set OS template permissions\n";
    if (is_openvz()) {
        lxfile_unix_chmod_rec("/vz/template/cache/", "0755");
    } else {
        lxfile_unix_chmod_rec("/home/hypervm/xen/template/", "0755");
    }
    call_with_flag("dofixParentClname");
    print "Get License\n";
    // ToDo: Why is this called this way....
    passthru("{$sgbl->__path_php_path} htmllib/lbin/getlicense.php");
    if (is_openvz()) {
        print "Check OpenVZ resources\n";
        if (call_with_flag("fixOpenVZResource")) {
            print "- Fixed\n";
        }
    }
    if (move_clients_to_client()) {
        print "Renamed clients directory to client.\n";
    }
    print "Checking backup dirs\n";
    if (!add_vps_backup_dir()) {
        print "- Everything is fine.\n";
    }
    print "Fix IP POOL\n";
    lxshell_return("__path_php_path", "../bin/fix/fixippool.php");
    if (call_with_flag("fix_ipaddress_column_type")) {
        print "Fixed IP address column in database\n";
    }
    if (call_with_flag("fix_vmipaddress")) {
        print "Fixed VM IP addresses in database\n";
    }
    print "Checking HIB template\n";
    get_kloxo_ostemplate();
    if (db_get_value("client", "admin", "contactemail")) {
        print "Set admin email\n";
        save_admin_email();
    }
    // Unknown usage within HyperVM, anyone can tell what this is doing?
    $file = "__path_program_root/etc/fixed_interface_template_sql";
    if (lxfile_exists($file)) {
        lxfile_touch($file);
        print "Check Interface Template (database)\n";
        system("mysql -u hypervm -p`cat ../etc/conf/hypervm.pass` hypervm1_0 < ../file/interface/interface_template.sql");
    }
    if (lxfile_exists("/etc/init.d/libvirtd")) {
        print "Make sure libvirtd is not started after reboot\n";
        system("chkconfig libvirtd off 2>/dev/null");
    }
    if (is_openvz()) {
        print "Checking for Base default OS template\n";
        $OSTemplateDir = "/vz/template/cache";
        $defaultOSTemplate = "centos-6-x86.tar.gz";
        $defaultOSTemplateName = "centos-6-x86";
        if (!lxfile_exists($OSTemplateDir)) {
            lxfile_mkdir($OSTemplateDir);
        }
        if (!lxfile_real("{$OSTemplateDir}/{$defaultOSTemplate}")) {
            lxfile_rm("{$OSTemplateDir}/{$defaultOSTemplate}");
            system("cd {$OSTemplateDir}/ ; wget http://download.hypervm-ng.org/download/openvztemplates/base/{$defaultOSTemplate}");
            system("rm {$OSTemplateDir}/index.html* 2>/dev/null");
            system("rm {$OSTemplateDir}/robots.txt* 2>/dev/null");
        }
        // Added in HyperVM 2.1.0
        if (lxfile_exists("/usr/sbin/vztmpl-dl")) {
            print "Checking for latest version of {$defaultOSTemplateName} at OpenVZ.org website\n";
            $res = system("/usr/sbin/vztmpl-dl --update {$defaultOSTemplateName} 2>/dev/null");
            dprint("res: {$res}\n");
        }
    } else {
        if (!lxfile_real("/home/hypervm/xen/template/centos-6-x86-pygrub-sda-latest.tar.gz")) {
            system("mkdir -p /home/hypervm/xen/template ; cd /home/hypervm/xen/template/ ; rm centos-6-i386.tar.gz; rm centos-5-i386.tar.gz; rm centos-5-i386-afull.tar.gz; rm centos-6-x86-pygrub-sda-latest.tar.gz; wget http://download.hypervm-ng.org/download/xentemplates/base/centos-6-x86-pygrub-sda-latest.tar.gz");
            system("rm /home/hypervm/xen/template/index.html* 2>/dev/null");
            system("rm /home/hypervm/xen/template/robots.txt* 2>/dev/null");
        }
    }
    print "Check for old critical database password bug\n";
    if (critical_change_db_pass()) {
        print "- Fixed critical database password bug!!!\n";
    } else {
        print "- Good! Already bug free :-)\n";
    }
    if (lxfile_exists("/etc/yum.repos.d/lxlabs.repo")) {
        print "Delete old repo's\n";
        lxfile_mv("/etc/yum.repos.d/lxlabs.repo", "/etc/yum.repos.d/lxlabs.repo.lxsave");
        system("rm -f /etc/yum.repos.d/lxlabs.repo");
        print "Removed lxlabs.repo\n";
    }
}
Ejemplo n.º 10
0
 function createExtraVariables()
 {
     global $gbl, $sgbl, $login, $ghtml;
     $gen = $login->getObject('general');
     $kloxo = $gen->kloxoconfig_b;
     $gen = $gen->generalmisc_b;
     if ($gen->xeninitrd_flag === 'off') {
         $this->__var_xeninitrd_flag = 'off';
     } else {
         $this->__var_xeninitrd_flag = 'on';
     }
     if ($this->dbaction === 'add' || ($this->subaction === 'reboot' || $this->subaction === 'boot' || $this->subaction === 'rebuild')) {
         if ($this->isOn('rootpassword_changed')) {
             $this->rootpassword_changed = 'off';
             $this->__var_rootpassword_changed = 'on';
         }
     }
     $this->__var_kloxo_remote_i_flag = $kloxo->remoteinstall_flag;
     $this->__var_kloxo_iapp_url = $kloxo->installapp_url;
     $this->__var_tmp_base_dir = db_get_value("pserver", $this->syncserver, "tmpdir");
     if (!$this->__var_tmp_base_dir) {
         $this->__var_tmp_base_dir = "/tmp";
     }
     $sq = new Sqlite(null, 'vps');
     $winip = null;
     if ($this->isWindows()) {
         $res = $sq->getRowsWhere("syncserver = '{$this->syncserver}' AND ostemplate LIKE 'windows%'", array('nname', 'hostname', 'coma_vmipaddress_a', 'macaddress', "networkgateway", "networknetmask", "nameserver"));
         if ($res) {
             foreach ($res as $r) {
                 foreach ($r as $k => $v) {
                     if ($k === 'coma_vmipaddress_a') {
                         $value['iplist'] = explode(",", $r['coma_vmipaddress_a']);
                     } else {
                         $value[$k] = $r[$k];
                     }
                 }
                 $winip[] = $value;
             }
         }
     }
     $this->__var_win_iplist = $winip;
     if ($this->isXen()) {
         return;
     }
     $res = $sq->getRowsWhere("syncserver = '{$this->syncserver}' AND priv_q_uplink_usage != 'Unlimited'", array('nname', 'vpsid', 'coma_vmipaddress_a', 'priv_q_uplink_usage'));
     $return = null;
     if ($res) {
         foreach ($res as $r) {
             $value['vpsid'] = $r['vpsid'];
             $value['nname'] = $r['nname'];
             if ($r['coma_vmipaddress_a']) {
                 $value['ipaddress'] = explode(",", $r['coma_vmipaddress_a']);
             } else {
                 $value['ipaddress'] = null;
             }
             $value['uplink_usage'] = $r['priv_q_uplink_usage'];
             $return[] = $value;
         }
     }
     $this->__var_uplink_list = $return;
 }
Ejemplo n.º 11
0
 while ($a = db_fetch_assoc($r)) {
     print "\t\t<item>\n";
     $title = $a["discussion_subject"];
     print "\t\t\t<title>" . htmlspecialchars(urldecode($title), ENT_QUOTES, 'utf-8') . "</title>\n";
     $storylink = "&story=" . $story_id . "&detail=" . $story_id . "#" . $a["discussion_id"];
     $storylink = $storylink = htmlspecialchars($storylink, ENT_QUOTES);
     $discusslink = $a["discussion_id"];
     print "\t\t\t<link>" . $link . $sectionlink . $pagelink . $storylink . "</link>\n";
     print "\t\t\t<guid isPermaLink=\"true\">" . $link . $sectionlink . $pagelink . $storylink . "</guid>\n";
     print "\t\t\t<pubDate>";
     print date("D, j M Y G:i:s O", strtotime(timestamp2usdate($a["discussion_tstamp"])));
     print "</pubDate>\n";
     print "\t\t\t<author>";
     print $a["user_fname"];
     $user_uname = $a["user_uname"];
     $user_email = db_get_value("user", "user_email", "user_uname='" . addslashes($user_uname) . "'");
     print " " . $user_email . "";
     print "</author>\n";
     print "\t\t\t<comments>";
     print $link . $sectionlink . $pagelink . $storylink;
     print "</comments>\n";
     $description = $a["discussion_content"];
     $description = convertTagsToInteralLinks($_REQUEST[site], $description);
     $description = str_replace("\n", "", $description);
     $description = str_replace("\r", "", $description);
     $description = htmlspecialchars(urldecode($description), ENT_QUOTES, 'utf-8');
     print "<description>";
     print $description;
     print "</description>\n";
     //if ($a["FK_media"]) {
     $b = db_get_line("media INNER JOIN slot ON media.FK_site=slot.FK_site", "media_id='" . addslashes($a["FK_media"]) . "'");
Ejemplo n.º 12
0
function save_admin_email()
{
    $a = null;
    $email = db_get_value("client", "admin", "contactemail");
    $a['admin']['contactemail'] = $email;
    slave_save_db("contactemail", $a);
}
Ejemplo n.º 13
0
	font-size: 10px;
}

</style>

<?php 
print $content;
$sa = db_get_line("sites", "name='" . addslashes($site) . "'");
$sections = decode_array($sa['sections']);
$nl = '';
if (!$user) {
    $user = $_SESSION['auser'];
} else {
    $nl = 'disabled';
}
$site_owner = db_get_value("sites", "addedby", "name='" . addslashes($site) . "'");
if ($_SESSION['auser'] == $site_owner) {
    //	print $sa[editors];	// Debug
    $editors = explode(",", $sa[editors]);
    $total_columns = count($editors) * 3 + 1;
    print "<table cellspacing='1' width='100%'>";
    print "<tr>";
    print "<td colspan='{$total_columns}' style='font-variant: small-caps'>";
    print "Editor permissions for <b>{$sa['title']}</b>";
    print "</td>";
    print "</tr>";
    print "<tr>";
    print "<th> &nbsp; </th>";
    foreach ($editors as $editor) {
        print "<th colspan='3'  style='border-left: 2px solid #fff;'>{$editor}</th>";
    }
Ejemplo n.º 14
0
 if (!ereg("^[a-zA-Z]{1,}\$", $_REQUEST['department'])) {
     error("You must enter a department. Only charactors \"a-z\" and \"A-Z\" are allowed.");
 }
 if (!ereg("^[0-9]{1,}\$", $_REQUEST['number'])) {
     error("You must enter a numeric number.");
 }
 if (!ereg("^[a-zA-Z0-9]{0,}\$", $_REQUEST['section'])) {
     error("Your course section must be letters \"a-z\" and \"A-Z\" only");
 }
 if (!array_key_exists($_REQUEST['semester'], $cfg['semesters'])) {
     error("You must enter a semester.");
 }
 if (!ereg("^[0-9]{4}\$", $_REQUEST['year'])) {
     error("You must enter a valid 4-digit year.");
 }
 $owner_id = db_get_value("user", "user_id", "user_uname='" . addslashes($_REQUEST['owner']) . "'");
 if (!$owner_id) {
     error("The class owner you selected is not a register Segue user.");
 }
 if (!$error) {
     $obj =& new course();
     $obj->fetchCourseID($_REQUEST['id']);
     $obj->external_id = $_REQUEST['external_id'];
     $obj->department = $_REQUEST['department'];
     $obj->number = $_REQUEST['number'];
     $obj->section = $_REQUEST['section'];
     $obj->semester = $_REQUEST['semester'];
     $obj->year = $_REQUEST['year'];
     $obj->name = $_REQUEST['name'];
     $obj->owner = $owner_id;
     //		$obj->ugroup = $ugroup_id;
Ejemplo n.º 15
0
    print "<div class='error'>You must be logged into Segue to use this link...</div>";
    print "</body</html>";
    link_log($auth_id, 0, $category = "errors", $description = "No Segue user authenticated");
    exit;
}
/******************************************************************************
 * Make sure a slot name is passed
 ******************************************************************************/
if (!isset($_REQUEST[site]) || !$_REQUEST[site]) {
    print "<div class='error'>No Segue site name or id passed...</div>";
    print "</body</html>";
    link_log($_SESSION[aid], 0, $category = "errors", $description = "No Segue site id passed");
    exit;
} else {
    $site_slot = $_REQUEST[site];
    $segue_site_id = db_get_value("slot", "FK_site", "slot_name='" . addslashes($site_slot) . "'");
    $node_id = $_REQUEST[node];
}
print "</div>";
//exit;
/******************************************************************************
 * Get Segue user information from Segue session array
 ******************************************************************************/
$segue_user_id = $_SESSION[aid];
$username = $_SESSION[auser];
$useremail = $_SESSION[aemail];
$userfname = $_SESSION[afname];
$names = split(" ", $userfname);
preg_match('/^(.*)\\s([^\\s]+)$/', $userfname, $matches);
$firstname = trim($matches[1]);
$lastname = trim($matches[2]);
Ejemplo n.º 16
0
 function generateDomainKey($dontwasflag)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $mmail = $this->getObject('mmail');
     $dns = $this->getObject('dns');
     $domainkeyflag = db_get_value('servermail', $mmail->syncserver, 'domainkey_flag');
     if (!isOn($domainkeyflag)) {
         $dns->RemoveDomainKey();
         if ($dontwasflag) {
             return;
         }
         $dns->setUpdateSubaction('full_update');
         $dns->was();
         return;
     }
     $dkey = rl_exec_in_driver($mmail, 'mmail', 'generateDKey', array($this->nname));
     if (!$dkey) {
         return;
     }
     $dns->addDomainKey($dkey);
     if ($dontwasflag) {
         return;
     }
     $dns->setUpdateSubaction('full_update');
     $dns->was();
 }
Ejemplo n.º 17
0
 function _output($cr, $o)
 {
     global $sid, $error, $showallauthors, $showposts, $uploadurl, $site_owner, $_full_uri;
     $siteOwnerId = db_get_value("user", "user_id", "user_uname='" . addslashes($site_owner) . "'");
     $parentAuthorId = db_get_value("discussion", "FK_author", "discussion_id='" . addslashes($this->parentid) . "'");
     //print $siteOwnerId;
     //printc("author=".$parentAuthorId);
     $siteObj =& $this->storyObj->owningSiteObj;
     $siteLevelEditors = $siteObj->getSiteLevelEditors();
     $isSiteEditor = in_array($_SESSION[auser], $siteLevelEditors);
     if ($showposts == 1 || ($_SESSION[auser] == $this->authoruname || $o == 1 || $isSiteEditor || $site_owner == $this->authoruname && $_SESSION[aid] == $parentAuthorId && $_SESSION[auser] || in_array($this->authoruname, $siteLevelEditors) && $_SESSION[aid] == $parentAuthorId && $_SESSION[auser])) {
         // check to see if we have any info to commit
         $this->_commithttpdata();
         if ($_REQUEST['discuss'] == 'edit' && $_REQUEST['id'] == $this->id) {
             $this->_outputform('edit');
             return true;
         }
         if ($_REQUEST['discuss'] == 'del' && $_REQUEST['id'] == $this->id) {
             $this->_del();
             return true;
         }
         if ($_REQUEST['discuss'] == 'rate' && $_REQUEST['id'] == $this->id) {
             $this->_outputform('rate');
             return true;
         }
         //$script = $_SERVER['SCRIPT_NAME'];
         /******************************************************************************
          * 	Outputs html for displaying posts
          * outputs discussion post info
          ******************************************************************************/
         if (!$this->id) {
             return false;
         }
         printc("\n<tr>");
         $s = "<a href='" . $_full_uri . "/index.php?{$sid}&amp;action=site&amp;" . $this->getinfo . "&amp;expand=" . $this->id . "' name='" . $this->id . "'>" . $this->subject . "</a>\n";
         //	printc ("</form>");
         //		$s = $this->subject;
         //printpre($_SESSION);
         $a = "";
         if ($showallauthors == 1 || $_SESSION[auser] && ($o || $_SESSION[auser] == $this->authoruname || $site_owner == $this->authoruname && $_SESSION[aid] == $parentAuthorId)) {
             if ($this->opt("showauthor")) {
                 $a .= "by <span class='subject'>" . $this->authorfname . "</span>\n";
             }
             if ($this->opt("showauthor") && $this->opt("showtstamp")) {
                 $a .= " on ";
             }
         } else {
             $a .= "posted on ";
         }
         if ($this->opt("showtstamp")) {
             $a .= timestamp2usdate($this->tstamp);
         }
         // Wiki-markup example
         global $storyObj;
         $a .= WikiResolver::getMarkupExample($storyObj->getField("title"), $this->id);
         /******************************************************************************
          * 	 collect possible actions to current post (rely | del | edit | rate)
          ******************************************************************************/
         $b = array();
         if ($cfg['disable_discussion'] != TRUE && ($cfg['disable_discussion'] != TRUE && $_SESSION['ltype'] == 'admin')) {
             if ($cr) {
                 $b[] = "<a href='" . $_full_uri . "/index.php?{$sid}" . $this->getinfo . "&amp;replyto=" . $this->id . "&amp;action=site&amp;discuss=reply#reply'>reply</a>\n";
             }
             if ($o || $_SESSION[auser] == $this->authoruname && !$this->dbcount()) {
                 $b[] = "| <a href='" . $_full_uri . "/index.php?{$sid}" . $this->getinfo . "&amp;action=site&amp;discuss=del&amp;id=" . $this->id . "'>delete</a>\n";
             }
             if ($_SESSION[auser] == $this->authoruname && !$this->dbcount()) {
                 $b[] = " | <a href='" . $_full_uri . "/index.php?{$sid}" . $this->getinfo . "&amp;id=" . $this->id . "&amp;action=site&amp;discuss=edit#" . $this->id . "'>edit</a>\n";
             }
             if ($o) {
                 $ratelink = "<a href='" . $_full_uri . "/index.php?{$sid}" . $this->getinfo . "&amp;id=" . $this->id . "&amp;action=site&amp;discuss=rate#" . $this->id . "'>rate</a>\n";
             }
         }
         /******************************************************************************
          * if there are dicussion actions (reply | del | edit | rate) then print 
          ******************************************************************************/
         if ($a != "" || count($b)) {
             $c = '';
             if (count($b)) {
                 $c .= implode(" ", $b);
             }
             /******************************************************************************
              * discussion post header info (subject=$s, author and timestamp=$a, options=$c)
              ******************************************************************************/
             //printc ("<table width='100%' cellspacing='0px'>\n");
             printc("\n<td class='dheader3'>\n");
             printc("<table width='100%' cellspacing='0px'>\n");
             printc("<tr><td align='left'>\n");
             printc("<span class='subject'>\n");
             // subject
             printc($s);
             // rating
             if ($this->rating !== NULL) {
                 printc(" (Rating: " . $this->rating . ")");
             }
             printc("</span></td>\n");
             // link for rating
             printc("<td align='right'>{$ratelink}</td>\n");
             printc("</tr><tr>\n");
             printc("<td>{$a}\n");
             printc("</td>\n");
             printc("<td align='right' valign='bottom'>{$c}</td>");
             printc("</tr>\n</table>\n");
             /******************************************************************************
              * if there are no dicussion actions (rely | del | edit | rate) then 
              * print subject only
              ******************************************************************************/
         } else {
             printc($s);
         }
         printc("</td></tr>");
         /******************************************************************************
          * 	print discussion post content
          ******************************************************************************/
         if ($this->opt("showcontent")) {
             printc("<tr><td class='dtext'>");
             if ($this->media_tag) {
                 $media_link = "<a href='" . $uploadurl . "/" . $_REQUEST[site] . "/" . $this->media_tag . "' target='media'>" . $this->media_tag . "</a>\n";
                 $mediaRow[media_tag] = $this->media_tag;
                 $mediaRow[slot_name] = $_REQUEST[site];
                 $mediaRow[media_size] = $this->media_size;
                 $audioplayer = printMediaPlayer($mediaRow);
                 $downloadlink = printDownloadLink($mediaRow);
                 //					$citation = printCitation($mediaRow);
                 // if attached file is an .mp3 print out audio player
                 if ($audioplayer) {
                     printc("<table width='100%' cellpadding='2' border='0'>");
                     printc("<tr><td>");
                     printc($downloadlink . "\n");
                     printc($audioplayer . "\n");
                     //						printc ("<div style='clear: left; font-size: smaller; margin-bottom: 10px; '>");
                     //						printc ($citation."\n");
                     //						printc ("</div>");
                     printc("</td></tr>");
                     printc("</table>");
                     // if attached file not .mp3 print out download link only
                 } else {
                     printc("<table width='100%' cellpadding='2' border='0'>");
                     printc("<tr><td>");
                     printc("<div style='clear: left; float: left; '>{$media_link}</div>\n");
                     printc($downloadlink . "\n");
                     printc("</td></tr>");
                     printc("</table>");
                 }
             }
             $content = convertTagsToInteralLinks($_REQUEST[site], stripslashes($this->content));
             $wikiResolver =& WikiResolver::instance();
             $content = $wikiResolver->parseText($content, $_REQUEST[site], $_REQUEST[section], $_REQUEST[page]);
             printc("<div style='clear: both;'>\n");
             printc($content);
             printc("</div>\n");
             //printc ("- [ $c]</td></tr>\n");
             //printc ("<tr><td align='right'>$c</td></tr>\n");
         }
         // done
         // now check if we're replying to this post
         if ($_REQUEST['discuss'] == 'reply' && $_REQUEST['replyto'] == $this->id) {
             $this->_outputform('reply');
         }
         //if ($_REQUEST['discuss'] == 'rate' && $_REQUEST['replyto'] == $this->id) $this->_outputform('rate');
         printc("</td></tr>");
     }
 }
Ejemplo n.º 18
0
             $participantslist .= "<div class='nav'>{$fname}</div>";
         }
         if ($utype == "prof") {
             $participantslist .= " (instructor)</td></tr>";
         } else {
             $participantslist .= "</td></tr>";
         }
     }
     $participantslist .= "</table>";
 }
 if (count($editors) > 2) {
     $editorslist = "<table cellspacing='3' cellpadding='0' width='100%'>";
     $editorslist .= "<tr><td><div class='nav'><strong><i>Editors</i></strong></div></td></tr>";
     foreach ($editors as $editor) {
         if ($editor != "everyone" && $editor != "institute") {
             $fname = db_get_value("user", "user_fname", "user_uname = '" . addslashes($editor) . "'");
             $contributions = participantContributions($editor, $site);
             $userDiscussions = participantDiscussions($editor, $site);
             //	printpre($contributions);
             $urlname = urlencode($fname);
             if ($contributions || $userDiscussions) {
                 //	printpre("ok");
                 //		$participantslist .= "<tr><td><a href='$PHPSELF?$sid&amp;site=$site&amp;section=$section&amp;page=$p&amp;action=$action&user=$editor'>$fname</a>";
             } else {
                 $editorslist .= "<tr><td><div class='nav'>{$fname}</div></td></tr>";
             }
         }
     }
     $editorslist .= "</table>";
 }
 //			$participant_sites_link = "<a href='$cfg[full_uri]/add_students.php?$sid&amp;name=$site' ";
Ejemplo n.º 19
0
/**
 * Return the id of the ugroup for the specified class
 * 
 * @param classId
 * @return integer
 * @access public
 * @date 10/7/04
 */
function getClassUGroupId($class_id)
{
    global $debug;
    $ugroup_id = db_get_value("ugroup", "ugroup_id", "ugroup_name = '" . addslashes($class_id) . "'");
    //$ugroup_id = db_get_value("class","FK_ugroup","class_external_id = '$class_id'");
    // If we don't have a ugroup id, then maybe we were passed the segue version of
    // the class Id instead of the external Id.
    if (!$ugroup_id) {
        $ugroup_id = db_get_value("class", "FK_ugroup", generateTermsFromCode($class_id));
    }
    if ($debug && !$ugroup_id) {
        printError("Could not find a ugroup id for class_id, '{$class_id}'");
    }
    return $ugroup_id;
}
Ejemplo n.º 20
0
     while ($orderedSet->hasNext()) {
         $item = $orderedSet->next();
         printpre($order . "-" . $item);
         // Update the db
         $query = "\n\t\t\tUPDATE\n\t\t\t\tstory\n\t\t\tSET\n\t\t\t\tstory_order =  '" . addslashes($order) . "'\n\t\t\tWHERE\n\t\t\t\tstory_id = '" . addslashes($item) . "'\n\t\t";
         //printpre($query);
         $r = db_query($query);
         $order++;
     }
     $showorder = "story";
     /******************************************************************************
      * Reordering of sections
      ******************************************************************************/
 } else {
     if ($_REQUEST['reorderSection']) {
         $site_id = db_get_value("slot", "FK_site", "slot_name='" . addslashes($_REQUEST['site']) . "'");
         $orderedSet = new OrderedSet(null);
         $query = "\n\t\tSELECT\n\t\t\tsection_id, section_order\n\t\tFROM\n\t\t\tsection\n\t\tWHERE\n\t\t\tFK_site = '" . addslashes($site_id) . "'\n\t\tORDER BY section_order\t\t\t\n\t";
         printpre($query);
         $r = db_query($query);
         // Populate the Set with the original page order
         while ($a = db_fetch_assoc($r)) {
             printpre($a['section_order'] . "-" . $a['section_id']);
             $orderedSet->addItem($a['section_id']);
         }
         // Move our page to its new position
         $orderedSet->moveToPosition($_REQUEST['reorderSection'], $_REQUEST['newPosition']);
         // Save the new order
         $orderedSet->reset();
         // Make sure the iterator is at the begining.
         $order = 0;
Ejemplo n.º 21
0
// (c) 2009-2010, Eolya - All Rights Reserved.
// This source code is the property of Eolya.
// The license applying to this source code is available at :
// http://www.crawl-anywhere.com/licenses/
//============================================================================
require_once "../init_gpc.inc.php";
require_once "../init.inc.php";
$action = POSTGET("action");
//TODO: V4
if ($action == "get_available_tags" || $action == "get_available_collections") {
    $id = "1";
    if (isset($_GET["uuid"]) && $_GET["uuid"] != "") {
        $uuid = $_GET["uuid"];
        $db = db_connect($config, "", "", "");
        if ($db) {
            $ret = db_get_value($db, "accounts", "id", "id_mysolrserver_instance='" . $uuid . "'", $id);
            if ($ret == -1) {
                $id = "1";
            }
        }
    }
}
//TODO: V4
if ($action == "get_available_tags") {
    $ret = "<?xml version=\"1.0\" encoding=\"utf-8\"?><result>";
    $ret .= "<status>ok</status>";
    $aTags = getAvailableTagsCollections($config, true, $id, 'tag');
    if ($aTags != null) {
        $ret .= "<tags>";
        for ($j = 0; $j <= count($aTags); $j++) {
            if ($aTags[$j] != "") {
Ejemplo n.º 22
0
 function createShowInfoList($subaction)
 {
     global $gbl, $sgbl, $login, $ghtml;
     if ($subaction) {
         return;
     }
     $resource = db_get_value('resourceplan', $this->resourceplan_used, 'realname');
     if (!$this->isAdmin()) {
         if ($this->isLogin()) {
             $ilist['Resource Plan'] = $resource;
         } else {
             $ilist['Resource Plan'] = "_lxinurl:a=updateform&sa=change_plan:{$resource}:";
         }
     }
     if ($this->priv->isOn('webhosting_flag')) {
         $url = "a=show&l[class]=ffile&l[nname]=/";
         $ilist['Home'] = "_lxinurl:{$url}:/home/{$this->getPathFromName()}/:";
         $ilist['FTP User'] = "******";
         $url = "&a=updateform&sa=default_domain";
         $ilist['Default Domain'] = "_lxinurl:{$url}:{$this->default_domain}:";
     }
     //$ilist['p'] = "$this->realpass";
     $this->getLastLogin($ilist);
     $skin = $this->getSpecialObject('sp_specialplay')->skin_name;
     //if ($skin === 'feather') { $skin .= " (beta)"; }
     $skin = ucfirst($skin);
     $url = "o=sp_specialplay&a=updateform&sa=skin";
     $ilist['Skin'] = "_lxinurl:{$url}:{$skin}:";
     if ($this->isNotCustomer()) {
         return $ilist;
     }
     if (check_if_many_server() && !$this->isLogin()) {
         $ilist['Web Server'] = $this->websyncserver;
         $ilist['Mail Server'] = $this->mmailsyncserver;
         $ilist['Mysql Server'] = $this->mysqldbsyncserver;
         if ($this->dnstemplate_list) {
             $ilist['Dns Servers'] = implode(",", $this->dnssyncserver_list);
         }
     }
     return $ilist;
 }
Ejemplo n.º 23
0
function switchserver_main()
{
    global $argc, $argv;
    global $gbl, $sgbl, $login, $ghtml;
    //sleep(60);
    initProgram("admin");
    if ($argc === 1) {
        print "Usage: {$argv['0']} --class= --name= --v-syncserver= \n";
        exit;
    }
    try {
        $opt = parse_opt($argv);
        $param = get_variable($opt);
        dprintr($param);
        $class = $opt['class'];
        $name = $opt['name'];
        if (lx_core_lock("{$class}-{$name}.livemigrate")) {
            exit;
        }
        $object = new $class(null, 'localhost', $name);
        $object->get();
        if ($object->dbaction === 'add') {
            throw new lxException("no_object", '', '');
            exit;
        }
        if (!$object->syncserver) {
            print "No_synserver...\n";
            throw new lxException("no_syncserver", '', '');
            exit;
        }
        if ($param['syncserver'] === $object->syncserver) {
            print "No Change...\n";
            throw new lxException("no_change", '', '');
            exit;
        }
        $driverapp_old = $gbl->getSyncClass('localhost', $object->syncserver, $object->getClass());
        $driverapp_new = $gbl->getSyncClass('localhost', $param['syncserver'], $object->getClass());
        $oldserver = $object->syncserver;
        $newserver = $param['syncserver'];
        if ($driverapp_new !== $driverapp_old) {
            throw new lxException("the_drivers_are_different_in_two_servers", '', '');
        }
        $actualserver = getFQDNforServer($newserver);
        setup_ssh_channel($oldserver, $newserver, $actualserver);
        $ssh_port = db_get_value("sshconfig", $newserver, "ssh_port");
        if (!$ssh_port) {
            $ssh_port = "22";
        }
        $res = rl_exec_get(null, $oldserver, "exec_vzmigrate", array($object->vpsid, $actualserver, $ssh_port));
        list($ret, $error) = $res;
        if ($ret !== 0) {
            throw new lxException("vzmigrate_failed_due_to:{$error}", '', '');
        }
        $object->olddeleteflag = 'done';
        $object->syncserver = $newserver;
        $object->username = null;
        $object->makeSureTheUserExists();
        $object->setUpdateSubaction();
        $object->write();
    } catch (exception $e) {
        print $e->getMessage();
        /// hcak ahck... Chnage only the olddelete variable which is the mutex used for locking in the process of switch. The problem is we want to totally bail out if the switchserver fails. The corect way would be save after reverting the syncserve to the old value, but that's a bit risky. So we just use a hack to change only the olddeleteflag; Not a real hack.. This is the better way.
        $message = "{$e->getMessage()}";
        $message = str_replace("'", "", $message);
        write_to_object($object, $message, $param['syncserver']);
        $fullmesage = "Switch of {$object->getClass()}:{$object->nname} to {$param['syncserver']} failed due to {$e->getMessage()}";
        log_switch($fullmesage);
        mail($login->contactemail, "Switch Failed:", "{$fullmesage}\n");
        print "\n";
        exit;
    }
    mail($login->contactemail, "Switch Succeeded", "Switch Succeeded {$object->getClass()}:{$object->nname} to {$param['syncserver']}\n");
}
 /**
  * Answer an element that represents a version of a story.
  * 
  * @param array $version
  * @param string $storyType One of link, rss, file, image, text
  * @param optional string $textType text or html
  * @return DOMITElement
  * @access protected
  * @since 3/24/08
  */
 function getVersion($version, $storyType, $textType = 'html', $obj = null)
 {
     $element = $this->_document->createElement('version');
     $element->setAttribute('id', $version['version_id']);
     $element->setAttribute('number', $version['version_order']);
     $element->setAttribute('time_stamp', $version['create_time_stamp']);
     $element->setAttribute('agent_id', $version['author_uname']);
     $commentElement = $element->appendChild($this->_document->createElement('comment'));
     $commentElement->appendChild($this->_document->createCDATASection($version['version_comments']));
     switch ($storyType) {
         case 'link':
             $field1 = 'description';
             $field2 = 'url';
             $value1 = urldecode($version['version_text_short']);
             $value2 = urldecode($version['version_text_long']);
             break;
         case 'rss':
             // RSS url info is not in the version, so just return it empty
             return $element;
         case 'file':
         case 'image':
             $field1 = 'description';
             $field2 = 'filename';
             $value1 = urldecode($version['version_text_short']);
             $filename = addslashes(urldecode(db_get_value("media", "media_tag", "media_id='" . addslashes(urldecode($version['version_text_long'])) . "'")));
             $value2 = htmlspecialchars($filename);
             break;
         default:
             $field1 = 'shorttext';
             $field2 = 'longertext';
             $value1 = stripslashes(convertInteralLinksToTags($obj->owning_site, urldecode($version['version_text_short'])));
             $value2 = stripslashes(convertInteralLinksToTags($obj->owning_site, urldecode($version['version_text_long'])));
     }
     $shortText = $element->appendChild($this->_document->createElement($field1));
     $shortText->appendChild($this->_document->createCDATASection($value1));
     $shortText->setAttribute('text_type', $textType);
     $shortText = $element->appendChild($this->_document->createElement($field2));
     $shortText->appendChild($this->_document->createCDATASection($value2));
     $shortText->setAttribute('text_type', $textType);
     return $element;
 }
Ejemplo n.º 25
0
<b>delete site</b> - option to delete a "slot" (only available <i>before</i> a site has been created in that location)<br />
<b>view site</b> - option to view an associated site (only available <i>after</i> a slot has been created in that location)<br />
<br /><br />

<table cellspacing='1' width='100%' id='maintable'>
<tr>
	<th width='20%'>Remove</th>
	<th width='60%'>Current Students</th>
	<th width='20%'>Associated Site</th>
</tr>
<?php 
/******************************************************************************
 * Lists all students who are members of the class
 * from getclassstudents($class_id) above
 ******************************************************************************/
$owner_uname = db_get_value("class", "FK_owner", "FK_ugroup = '" . addslashes($ugroup_id) . "'");
foreach (array_keys($participants) as $key) {
    //printpre($participants[$key][uname]);
    print "<tr>";
    /******************************************************************************
     * If not site owner and participant not from LDAP
     * print out delete button
     ******************************************************************************/
    print "<td align='center'  class='td{$color}'>";
    if ($owner_uname != $participants[$key][uname] && $participants[$key][memberlist] != "external") {
        print "<input type='button' name='use' value='remove' onclick=\"delStudent('" . $participants[$key][id] . "','" . $participants[$key][fname] . " (" . $participants[$key][uname] . ")')\" />";
    }
    print "</td>";
    /******************************************************************************
     * Print out participant/student names
     ******************************************************************************/
Ejemplo n.º 26
0
// get the correct shorttext
if ($storyObj->getField("type") == 'story') {
    $smalltext = convertTagsToInteralLinks($siteObj->name, $storyObj->getField("shorttext"));
    $fulltext = convertTagsToInteralLinks($siteObj->name, $storyObj->getField("longertext"));
    $smalltext = stripslashes($smalltext);
    $fulltext = stripslashes($fulltext);
    if ($storyObj->getField("texttype") == 'text') {
        $fulltext = htmlbr($fulltext);
    }
    if ($storyObj->getField("texttype") == 'text') {
        $smalltext = htmlbr($smalltext);
    }
}
if ($storyObj->getField("type") == 'image') {
    $filename = urldecode(db_get_value("media", "media_tag", "media_id='" . addslashes($storyObj->getField("longertext")) . "'"));
    $dir = db_get_value("media INNER JOIN slot ON media.FK_site = slot.FK_site", "slot_name", "media_id='" . addslashes($storyObj->getField("longertext")) . "'");
    $imagepath = "{$uploadurl}/{$dir}/{$filename}";
    $fulltext = "\n<div style='text-align: center'><br /><img src='{$imagepath}' border='0' /></div>";
    /* 	if ($story->getField("title")) $fulltext .= "<tr><td align='center'><b>".spchars($story->getField("title"))."</b></td></tr>"; */
    if ($storyObj->getField("shorttext")) {
        $captiontext = $st = convertTagsToInteralLinks($site, $storyObj->getField("shorttext"));
        $captiontext = "<br />" . stripslashes($captiontext);
    }
    $fulltext .= "";
}
if ($storyObj->getField("type") == 'file') {
    $fulltext = "<br />";
    $fulltext .= makedownloadbar($storyObj);
}
/******************************************************************************
 * print out shory and discussion (if any)
Ejemplo n.º 27
0
<?php

/*
 * This file is used by the /login/ page.
 * Refactoring is needed. Wrong place, wrong name
 */
$accountlist = array('client' => "Kloxo Account", 'domain' => 'Domain Owner', 'mailaccount' => "Mail Account");
$progname = $sgbl->__var_program_name;
$ghtml->print_jscript_source("/htmllib/js/lxa.js");
if ($sgbl->is_this_slave()) {
    print "Slave Server\n";
    exit;
}
$logfo = db_get_value("general", "admin", "login_pre");
$logfo = str_replace("<%programname%>", $sgbl->__var_program_name, $logfo);
if (!$cgi_forgotpwd) {
    $ghtml->print_message();
    if (if_demo()) {
        include_once "lib/demologins.php";
    } else {
        ?>

        <div id="ctr" align="center">
            <div class="login">
                <div class="login-form">
                    <div align="center"><font size="5" color="red"><b> Login </b></font></div>
                    <br />
                    <form name="loginform" action="/htmllib/phplib/" onsubmit="encode_url(loginform) ; return fieldcheck(this);" method="post">
                        <div class="form-block">
                            <div class="inputlabel">Username</div>
                            <input name="frm_clientname" type="text" class="inputbox" size="30" />
Ejemplo n.º 28
0
                 $message .= "<br />(" . $cfg[auth_help] . ")<br /><br />";
             }
         } else {
             $message = "You cannot register your {$cfg['inst_name']} account here.<br /></div>";
             if ($cfg['auth_help_on']) {
                 $message .= "<br />(" . $cfg[auth_help] . ")<br /><br />";
             }
         }
         $id = 0;
         $error = TRUE;
         break;
     }
 }
 $id = db_get_value("user", "user_id", "user_email='" . addslashes($email) . "'");
 if ($id) {
     $authtype = db_get_value("user", "user_authtype", "user_id = '" . addslashes($id) . "'");
 }
 if ($id && $authtype != "db") {
     $error = TRUE;
     $message = "<div align='left'>This user account is not authenticated by Segue and so you cannot reset this account's password here.<br /></div>";
 }
 /******************************************************************************
  * a matching user was found and email not excluded
  ******************************************************************************/
 if ($id > 0 && $error != TRUE) {
     if ($_REQUEST[action] == "send") {
         $obj =& new user();
         $obj->fetchUserID($id);
         $obj->randpass(5, 3);
         $obj->updateDB();
         $obj->sendemail(1);
Ejemplo n.º 29
0
 function isQuotaVariableSpecific($var)
 {
     global $gbl, $sgbl, $login, $ghtml;
     if ($var === 'frontpage_flag') {
         $v = db_get_value("pserver", $this->syncserver, "osversion");
         if (csa($v, " 5")) {
             return false;
         }
         $driverapp = $gbl->getSyncClass(null, $this->syncserver, 'web');
         if ($driverapp === 'lighttpd') {
             return false;
         }
     }
     return true;
 }
Ejemplo n.º 30
0
 function parseMediaTextForEdit($field)
 {
     if (!$this->getField("{$field}")) {
         return false;
     }
     $this->data[$field] = ereg_replace("src=('{0,1})####('{0,1})", "####", $this->getField($field));
     $textarray1 = explode("####", $this->getField($field));
     if (count($textarray1) > 1) {
         for ($i = 1; $i < count($textarray1); $i += 2) {
             $id = $textarray1[$i];
             $filename = db_get_value("media", "media_tag", "media_id='" . addslashes($id) . "'");
             $query = "\n\t\t\t\t\tSELECT \n\t\t\t\t\t\tslot_name \n\t\t\t\t\tFROM\n\t\t\t\t\t\tmedia \n\t\t\t\t\t\t\tINNER JOIN \n\t\t\t\t\t\tsite ON media.FK_site = site_id\n\t\t\t\t\t\t\tINNER JOIN\n\t\t\t\t\t\tslot ON site_id = slot.FK_site\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tmedia_id = '" . addslashes($id) . "'\n\t\t\t\t";
             $a = db_fetch_assoc(db_query($query));
             $dir = $a[slot_name];
             $filepath = $uploadurl . "/" . $dir . "/" . $filename;
             $textarray1[$i] = "&&&& src='" . $filepath . "' @@@@" . $id . "@@@@ &&&&";
         }
         $this->data[$field] = implode("", $textarray1);
     }
 }