static function ticketSendNotification($from, $id, $category, $object, $action, $actxt, $made_by, $subject, $message, $extra = null) { global $gbl, $sgbl, $login, $ghtml; $o = $login->getObject('ticketconfig'); $name = ucfirst($sgbl->__var_program_name); $notf = $object->getObject('notification'); $val = null; $flag = $action . "_flag"; if (!$object->contactemail || !$notf->notflag_b->isOn($flag)) { return; } log_message("Sending Notification {$subject} to {$object->nname} {$object->contactemail} \n"); $subject = "[ticket:{$object->nname}:{$id}] {$subject}"; list($parentclass, $parentname) = getParentNameAndClass($made_by); $mail = null; if ($o->isOn('mail_enable')) { $mail .= "When replying please leave the subject intact for the helpdesk to parse...\n-----\n"; } $mail .= "A ticket {$actxt} by {$parentclass}:{$parentname} at the {$name} ticketing system\n"; $mail .= "Message:\n--------------------------\n"; $mail .= $message; $mail .= "\n--------------------\n"; $reply_to = $o->mail_account; if (!$reply_to) { $reply_to = "helpdesk"; } $extra .= "Reply-To: {$reply_to}\n"; $extra .= "X-Category: {$category}\n"; $contactemail = $object->getAllContactEmail(); callInBackground('lx_mail', array($from, $contactemail, $subject, $mail, $extra)); }
function moveToClient() { global $gbl, $sgbl, $login, $ghtml; $login->loadAllObjects('ftpuser'); $l = $login->getList('ftpuser'); foreach ($l as $b) { if (csb($b->parent_clname, 'web-')) { list($parentclass, $parentname) = getParentNameAndClass($b->parent_clname); $d = new Domain(null, null, $parentname); $d->get(); $b->parent_clname = $d->parent_clname; $w = $d->getObject('web'); $b->directory = "{$w->docroot}/{$b->directory}"; $b->directory = remove_extra_slash($b->directory); $b->setUpdateSubaction(); $b->write(); } } $login->loadAllObjects('mysqldb'); $l = $login->getList('mysqldb'); foreach ($l as $b) { if (csb($b->parent_clname, 'domain-')) { list($parentclass, $parentname) = getParentNameAndClass($b->parent_clname); $d = new Domain(null, null, $parentname); $d->get(); $b->parent_clname = $d->parent_clname; $b->setUpdateSubaction(); $b->write(); } } }
static function generateKloxoUrl($parentclname, $selfurl, $url) { global $gbl, $sgbl, $login, $ghtml; if (!$selfurl) { $selfurl = "frm_action=show"; } if (is_object($parentclname)) { $parent = $parentclname; } else { list($class, $name) = getParentNameAndClass($parentclname); $parent = new $class(null, null, $name); $parent->get(); } $string = 'secret'; $ssl['string'] = $string; $priv_key_res = openssl_get_privatekey($parent->text_private_key, ""); openssl_private_encrypt($string, $encrypted_string, $priv_key_res); $ssl['encrypted_string'] = base64_encode($encrypted_string); $selfip = $_SERVER['SERVER_NAME']; list($host, $port) = explode(":", $selfip); if ($port === '8887') { $prot = "https"; $lxport = "7777"; } else { $prot = "http"; $lxport = "7778"; } $ssl_param['backurl'] = "{$prot}://{$selfip}/display.php?{$selfurl}"; $ssl_param['backbase'] = "{$prot}://{$selfip}/display.php"; $ssl_param['parent_clname'] = $parent->getClName(); $ssl['ssl_param'] = $ssl_param; $ssl = base64_encode(serialize($ssl)); if ($parent->isClass('pserver')) { $ip = getOneIPForServer($parent->nname); } else { if ($parent->mainipaddress) { $ip = $parent->mainipaddress; } else { $ip = getFirstFromList($parent->vmipaddress_a)->nname; } if (!$ip) { throw new lxexception("no_ipaddress_for_the_vps", '', $name); } } $url = @$ghtml->getFullUrl($url, null); $url = "{$prot}://{$ip}:{$lxport}/{$url}&frm_ssl={$ssl}"; return $url; }
function getClassAndName($name) { return getParentNameAndClass($name); }
function convertClCmToNameCm($cmlist) { $v = explode(",", $cmlist); $nv = null; foreach ($v as $__q) { if ($__q) { //list($pclass, $pname) = explode("_s_vv_p_", $__q); list($pclass, $pname) = getParentNameAndClass($__q); $nv[] = $pname; } } return implode(", ", $nv); }