Example #1
0
function print_index()
{
    global $gbl, $sgbl, $ghtml, $login;
    ob_start();
    print_time('index');
    $cgi_clientname = $ghtml->frm_clientname;
    Htmllib::checkForScript($cgi_clientname);
    $cgi_class = $ghtml->frm_class;
    if (!$cgi_class) {
        $cgi_class = getClassFromName($cgi_clientname);
    }
    $cgi_password = $ghtml->frm_password;
    $cgi_forgotpwd = $ghtml->frm_forgotpwd;
    $cgi_email = $ghtml->frm_email;
    $cgi_key = $ghtml->frm_login_key;
    if (!$cgi_password || !$cgi_clientname) {
        $ghtml->print_redirect("/login/?frm_emessage=login_error");
    }
    $cgi_classname = 'client';
    if ($cgi_class) {
        $cgi_classname = $cgi_class;
    }
    if ($cgi_clientname == "" || $cgi_password == "" && $cgi_key == "") {
        $cgi_forgotpwd = $ghtml->frm_forgotpwd;
        return;
    }
    $ip = $_SERVER['REMOTE_ADDR'];
    if (!check_login_success($cgi_classname, $cgi_clientname, $cgi_password, $cgi_key)) {
        return;
    }
    log_log("login_success", "Successful Login to {$cgi_clientname} from " . $_SERVER['REMOTE_ADDR']);
    /*
    	try {
    		$att = $gbl->g->getFromList("loginattempt", $ip);
    		$att->delete();
    } catch (Exception $e) {
    }
    */
    if (check_disable_admin($cgi_clientname)) {
        $ghtml->print_redirect("/login/?frm_emessage=login_error");
        exit;
    }
    if (get_login($cgi_classname, $cgi_clientname)) {
        do_login($cgi_classname, $cgi_clientname);
        $login->was();
        check_blocked_ip();
        $ghtml->print_redirect("/");
    } else {
        $ghtml->cgiset("frm_emessage", "login_error");
    }
    $cgi_forgotpwd = $ghtml->frm_forgotpwd;
}
Example #2
0
 function __construct()
 {
     parent::__construct();
 }
Example #3
0
    function printObjectElement($parent, $class, $classdesc, $obj, $name, $width, $descr, $colcount)
    {
        global $gbl, $sgbl, $login;
        $rclass = $class;
        list($graphtype, $graphwidth) = exec_class_method($rclass, "getGraphType");
        if ($name === 'syncserver') {
            $serverdiscr = pserver::createServerInfo(array($obj->syncserver), $class);
        }
        $__external = 0;
        $iconpath = get_image_path() . "/button/";
        if (isset($descr[$name]) && (csa($descr[$name][0], 'q') || csa($descr[$name][0], "D"))) {
            // For hard quota you need priv. For soft quota, you use used.
            if (csa($descr[$name][0], 'h')) {
                $pname = $obj->priv->display($name);
            } else {
                $pname = $obj->used->display($name);
            }
        } else {
            if (isset($descr[$name]) && csa($descr[$name][0], 'p')) {
                if (cse($name, "_per_f")) {
                    $qrname = strtil($name, "_per_f");
                    $pname = array($obj->priv->{$qrname}, $obj->used->{$qrname}, null);
                } else {
                    $pname = $obj->perDisplay($name);
                }
            } else {
                $pname = $obj->display($name);
                $pname = Htmllib::fix_lt_gt($pname);
                if (csa($pname, "_lximg:")) {
                    $pname = preg_replace("/_lximg:([^:]*):([^:]*):([^:]*):/", "<img src=\$1 width=\$2 height=\$3>", $pname);
                }
                if (csa($pname, "_lxspan:")) {
                    $pname = preg_replace("/_lxspan:([^:]*):([^:]*):/", "<span title='\$2'>\$1 </span> ", $pname);
                }
                if (csa($pname, "_lxurl:")) {
                    $pname = preg_replace("/_lxurl:([^:]*):([^:]*):/", "<a class=insidelist target=_blank href=http://\$1> \$2 </a>", $pname);
                }
                if (csa($pname, "_lxinurl:")) {
                    $url = preg_replace("/_lxinurl:([^:]*):([^:]*):/", "\$1", $pname);
                    $url = $this->getFullUrl($url);
                    $url = "\"{$url}\"";
                    $pname = preg_replace("/_lxinurl:([^:]*):([^:]*):/", "<a class=insidelist href={$url}> \$2 </a>", $pname);
                }
                if ($name === 'syncserver') {
                    $pname = "<span title='{$serverdiscr}'>  {$pname} </span> ";
                }
            }
        }
        $wrapstr = $width === "100%" ? "wrap" : "nowrap";
        $target = NULL;
        $purl = NULL;
        $url = null;
        $__full_url = false;
        if ($name === 'parent_name_f' && csb($class, "all_")) {
            $url = $this->generateParentListUrl($obj);
            $ac_descr = $this->getActionDetails($url, $purl, $iconpath, $path, $post, $_t_file, $_t_name, $_t_image, $__t_identity);
            $__full_url = true;
            $__full_url_t_identity = $__t_identity;
        }
        if (isset($descr[$name][3]) || csa($name, "abutton_")) {
            if (csa($name, "abutton_")) {
                $urlname = $obj->nname;
                $str = strfrom($name, "abutton_");
                $_tv = explode("_s_", $str);
                if ($_tv[0] === 'list') {
                    $url = "a=list&c={$_tv[1]}";
                } else {
                    if ($_tv[0] === 'show') {
                        $url = "a=show&o={$_tv[1]}";
                    } else {
                        $url = "a={$_tv['0']}&sa={$_tv[1]}";
                    }
                }
                $url = "&k[class]={$class}&k[nname]={$urlname}&{$url}";
            } else {
                if ($this->is_special_url($descr[$name][3])) {
                    $url = $descr[$name][3];
                } else {
                    if (csb($descr[$name][3], "__stub")) {
                        $url = $obj->getStubUrl($descr[$name][3]);
                    } else {
                        if (csb($class, "all_")) {
                            $url = $this->generateEntireUrl($obj, $login);
                            if (!$url) {
                                /// That means that the object is dangling and has no parent.
                                throw new lxException("object_found_without_proper_parent");
                            }
                        } else {
                            $urlname = $obj->nname;
                            $url = $descr[$name][3] . "&k[class]={$class}&k[nname]={$urlname}";
                        }
                    }
                }
            }
            if ($this->is_special_url($url)) {
                $purl = $url->purl;
                $target = $url->target;
                $url = $url->url;
                $purl = $this->getFullUrl($purl);
                $url = str_replace("[%s]", $obj->nname, $url);
                if (strpos($url, "http:/") !== false) {
                    $__external = 1;
                }
            } else {
                $url = $this->getFullUrl($url);
            }
            $ac_descr = $this->getActionDetails($url, $purl, $iconpath, $path, $post, $_t_file, $_t_name, $_t_image, $__t_identity);
        }
        $align = 'left';
        $valign = 'middle';
        $image = 0;
        if (csa($descr[$name][0], "e")) {
            $pname = strtolower($pname);
            $property = "{$name}_v_{$pname}";
            $prop_descr = get_classvar_description($rclass, $property);
            if (!$prop_descr) {
                dprint("Property Description for {$rclass} {$property} not Found <br> \n");
            }
            $this->fix_variable_overload($prop_descr, $classdesc[2]);
            $image = $this->get_image($iconpath, $class, $property, ".gif");
            $help = $this->get_full_help($prop_descr['help'], $obj->getId());
            $alt = lx_strip_tags($help);
            $help = $this->get_action_or_display_help($help, "notice");
            $align = "center onmouseover=\"changeContent('help',' {$help}')\" onmouseout=\"changeContent('help','helparea')\"";
            if (!$sgbl->isBlackBackground()) {
                $pname = " <span title='{$alt}'><img src={$image} width=16 height=16 >";
            }
            $this->save_non_existant_image($image);
            $image = 1;
        }
        if (!$obj->isAction($name) && char_search_a($descr[$name][0], "b")) {
            $pname = "";
        }
        $bgcolorstring = null;
        $forecolorstring = null;
        if ($sgbl->isBlackBackground()) {
            $bgcolorstring = "bgcolor=#000";
            $forecolorstring = "color=#999999";
        }
        if ($url && $obj->isAction($name)) {
            $urlhelp = "";
            if (!$image) {
                $this->fix_variable_overload($ac_descr, $classdesc[2]);
                // When it is showing the parent name, it is showing the resource under that parent, nad not under this object.
                if ($__full_url) {
                    $help = $this->get_full_help($ac_descr[2], $__full_url_t_identity);
                } else {
                    $help = $this->get_full_help($ac_descr[2], $obj->getId());
                }
                $alt = lx_strip_tags($help);
                $help = $this->get_action_or_display_help($help, "action");
                $urlhelp = "onmouseover=\"changeContent('help',' {$help}')\" onmouseout=\"changeContent('help','helparea')\"";
                if (strstr($descr[$name][0], "b") != NULL || csb($name, "abutton")) {
                    if ($obj->isButton($name)) {
                        if ($sgbl->isBlackBackground()) {
                            $pname = "b";
                        } else {
                            $pname = " <span title='{$alt}'><img src='{$_t_image}'  height=15 width=15>";
                        }
                        $align = "center";
                    } else {
                        $pname = "";
                    }
                }
            }
            print "<td {$bgcolorstring} class=collist {$wrapstr} align={$align} > <span title='{$alt}'>";
            $method = $__external ? "get" : $sgbl->method;
            ?>
		<form name=form<?php 
            echo $colcount;
            ?>
  method=<?php 
            echo $method;
            ?>
 action=<?php 
            echo $path;
            ?>
 <?php 
            echo $target;
            ?>
 >
			<?php 
            if ($this->frm_action === 'selectshow') {
                $post['frm_action'] = 'selectshow';
                $post['frm_selectshowbase'] = $this->frm_selectshowbase;
            }
            $this->print_input_vars($post);
            ?>
		</form>
		<a class=insidelist
		   href="javascript:document.form<?php 
            echo $colcount;
            ?>
.submit()" <?php 
            echo $urlhelp;
            ?>
 > <?php 
            echo $pname;
            ?>
   </a>  </span> </td>
			<?php 
        } else {
            if (char_search_a($descr[$name][0], "p")) {
                print "<td {$bgcolorstring} class=collist {$wrapstr} align={$align} > ";
                $arr = $pname;
                $this->show_graph($arr[0], $arr[1], null, $graphwidth, $arr[2], $graphtype, $obj->getId(), $name);
                print "</td>  ";
            } else {
                if (csa($descr[$name][0], "W")) {
                    $pname = str_replace("\n", "<br>\n", $pname);
                    $pname = str_replace("[code]", "<div style='padding: 10 10 10 10; margin: 10 10 10 10; border: 1px solid #43a1a1'>", $pname);
                    $pname = str_replace("[quote]", "<div style='background:#eee; padding: 10 10 10 10; margin: 10 10 10 10; border: 1px solid #aaa'> [b] QUOTE [/b]", $pname);
                    $pname = str_replace("[b]", "<font style='font-weight:bold'>", $pname);
                    $pname = str_replace("[/b]", "</font>", $pname);
                    $pname = str_replace("[/code]", "</div>", $pname);
                    $pname = str_replace("[/quote]", "</div>", $pname);
                    $pname = "<table width=100% style='background:white;padding:20 20 20 20; margin: 8 8 8 8 ;border: 1px solid grey;' cellpadding=0 cellspacing=0> <tr> <td  > {$pname} </td> </tr> </table>  ";
                }
                print "<td {$bgcolorstring} class=collist {$wrapstr} align={$align} >  {$pname}   </td>  ";
                //print("<td class=collist $wrapstr align=$align onClick=\"javascript:getElementById('input$oname$name').type='text'; getElementById('font$oname$name').style.display='none'\"> <input \"style=width:60\" id=input$oname$name type=hidden name=hello value=$pname> <font id=font$oname$name> $pname </font>  </td>  ");
            }
        }
    }
Example #4
0
 function updateform($subaction, $param)
 {
     $vlist['made_by'] = array('M', $this->getParentName('made_by'));
     $vlist['subject'] = array('M', Htmllib::fix_lt_gt($this->subject));
     $vlist['ddate'] = array('M', lxgettime($this->ddate));
     if ($this->getParentO()->getClName() === $this->made_by) {
         $sent = $this->convertClCmToNameCm($this->text_sent_to_cmlist);
         $vlist['text_sent_to_cmlist'] = array('M', $sent);
     } else {
         $sent = $this->getParentO()->nname;
     }
     $vlist['text_description'] = array('t', null);
     if (!$this->isRightParent()) {
         $vlist['__v_button'] = array();
     }
     return $vlist;
 }