[cosm] many cosmetic comment fixes, + ensure license and copyright everywhere

This commit is contained in:
Benjamin Sonntag 2017-10-08 19:31:34 +02:00
parent 18888645a9
commit 5b7622ce90
27 changed files with 386 additions and 230 deletions

View File

@ -1,13 +1,5 @@
<?php
/*
$Id: adm_panel.php,v 1.9 2005/08/01 18:25:52 anarcat Exp $
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2002 by the AlternC Development Team.
http://alternc.org/
----------------------------------------------------------------------
Based on:
Valentin Lacambre's web hosting softwares: http://altern.org/
----------------------------------------------------------------------
LICENSE
@ -23,10 +15,8 @@
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
Original Author of file: Benjamin Sonntag
Purpose of file: Panneau de control de l'administrateur
----------------------------------------------------------------------
*/
require_once("../class/config.php");
if (!$admin->enabled) {

View File

@ -1,6 +1,28 @@
<?php
/*
----------------------------------------------------------------------
LICENSE
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License (GPL)
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
*/
/**
* bind9 file management class
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class system_bind {
var $ZONE_TEMPLATE ="/etc/alternc/templates/bind/templates/zone.template";
var $NAMED_TEMPLATE ="/etc/alternc/templates/bind/templates/named.template";
@ -17,12 +39,6 @@ class system_bind {
var $cache_domain_summary = array();
var $zone_file_directory = '/var/lib/alternc/bind/zones/';
/**
*
*/
function system_bind() {
// Constructeur
}
/**
* Return the part of the conf we got from the database
@ -62,6 +78,7 @@ class system_bind {
return $this->cache_conf_db;
}
/**
* Return full path of the zone configuration file
*
@ -72,6 +89,7 @@ class system_bind {
return $this->zone_file_directory.$domain;
}
/**
*
* @param string $domain
@ -89,6 +107,7 @@ class system_bind {
return $this->cache_zone_file[$domain] ;
}
/**
*
* @param string $domain
@ -113,6 +132,7 @@ class system_bind {
return max(array($calc,$old)) + 1 ;
}
/**
* Return lines that are after ;;; END ALTERNC AUTOGENERATE CONFIGURATION
*
@ -131,6 +151,7 @@ class system_bind {
return $this->cache_get_persistent[$domain];
}
/**
*
* @return string
@ -139,6 +160,7 @@ class system_bind {
return file_get_contents($this->ZONE_TEMPLATE);
}
/**
*
* @global m_dom $dom
@ -157,6 +179,7 @@ class system_bind {
else return $this->cache_domain_summary;
}
/**
*
* @param string $domain
@ -172,6 +195,7 @@ class system_bind {
return true;
}
/**
* Generate the domain DKIM key
*
@ -202,6 +226,7 @@ class system_bind {
return true; // FIXME handle error
}
/**
* Refresh DKIM configuration: be sure to list the domain having a private key (and only them)
*/
@ -259,6 +284,8 @@ class system_bind {
}
}
/**
*
* @param string $domain
@ -273,6 +300,7 @@ class system_bind {
return @file_get_contents($keyfile);
}
/**
* Conditionnal generation autoconfig entry for outlook / thunderbird
* If entry with the same name allready exist, skip it.
@ -349,6 +377,7 @@ class system_bind {
return $zone;
}
/**
*
* @param string $domain
@ -360,6 +389,7 @@ class system_bind {
}
}
/**
* return true if zone is locked
*
@ -374,6 +404,7 @@ class system_bind {
return false;
}
/**
*
* @global m_mysql $db
@ -401,6 +432,7 @@ class system_bind {
return true; // fixme add tests
}
/**
* Delete the zone configuration file
*
@ -416,6 +448,7 @@ class system_bind {
return true;
}
/**
*
* @global m_hooks $hooks
@ -446,6 +479,7 @@ class system_bind {
return true;
}
/**
* Regenerate bind configuration and load it
*
@ -478,6 +512,7 @@ class system_bind {
return true;
}
/**
*
*/
@ -485,7 +520,6 @@ class system_bind {
_("The zone file of this domain is locked. Contact your administrator.");
}
} // class
} /* Class system_bind */
?>

View File

@ -1,14 +1,6 @@
<?php
/*
$Id: config.php,v 1.12 2005/12/18 09:51:32 benjamin Exp $
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2002 by the AlternC Development Team.
http://alternc.org/
----------------------------------------------------------------------
Based on:
Valentin Lacambre's web hosting softwares: http://altern.org/
----------------------------------------------------------------------
LICENSE
@ -24,11 +16,16 @@
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
Original Author of file: Benjamin Sonntag
Purpose of file: General configuration file for AlternC Desktop
----------------------------------------------------------------------
*/
/**
* Main configuration file (BOOSTRAP) of AlternC
* control panel. Include this to load everything and ensure
* the user is connected
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
define('DO_XHPROF_STATS', FALSE);
if (DO_XHPROF_STATS) {
require_once('/usr/share/alternc/panel/admin/xhprof_header.php');
@ -42,18 +39,6 @@ if (file_exists('/etc/alternc/alternc_display_php_error')) {
session_name('AlternC_Panel');
session_start();
/*
Si vous voulez mettre le bureau en maintenance, decommentez le code ci-dessous
et mettez votre ip dans le IF pour que seule votre ip puisse acceder au bureau :
*/
/* * /
if (getenv("REMOTE_ADDR")!="127.0.0.1") {
echo "Le bureau AlternC est en vacances jusqu'a minuit pour maintenance.<br>
Merci de revenir plus tard.";
exit();
}
/* */
if (ini_get("safe_mode")) {
echo _("SAFE MODE IS ENABLED for the web panel ! It's a bug in your php or apache configuration, please fix it !!");
@ -71,7 +56,7 @@ if (isset($http_auth)) {
}
}
if (!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) {
// Gruiiik
// Gruiiik does http-auth : simulate a posted-login/pass
$_REQUEST["username"] = $_SERVER['PHP_AUTH_USER'];
$_REQUEST["password"] = $_SERVER['PHP_AUTH_PW'];
}
@ -88,9 +73,11 @@ $host = getenv("HTTP_HOST");
/* Global variables (AlternC configuration) */
require_once(dirname(__FILE__) . "/local.php");
// Define constants from vars of /etc/alternc/local.sh
// The you can't choose where is the AlternC Panel
/**
* Define constants from vars of /etc/alternc/local.sh
* The you can't choose where is the AlternC Panel
*/
define("DEFAULT_PASS_SIZE", 10);
define('ALTERNC_MAIL', "$L_ALTERNC_MAIL");
define('ALTERNC_HTML', "$L_ALTERNC_HTML");
@ -116,14 +103,12 @@ require_once($root . "/class/functions.php");
require_once($root . "/class/variables.php");
// Classe h<>rit<69>e de la classe db de la phplib.
/**
* Class for MySQL management in the bureau
/**
* Class for MySQL management in the panel
*
* This class heriting from the db class of the phplib manages
* the connection to the MySQL database.
*/
*/
class DB_system extends DB_Sql {
function __construct() {
global $L_MYSQL_HOST,$L_MYSQL_DATABASE,$L_MYSQL_LOGIN,$L_MYSQL_PWD;
@ -132,22 +117,23 @@ class DB_system extends DB_Sql {
}
$db = new DB_system();
// $db = new Sql($L_MYSQL_DATABASE, $L_MYSQL_HOST, $L_MYSQL_LOGIN, $L_MYSQL_PWD);
// Current User ID = the user whose commands are made on behalf of.
$cuid = 0;
$classes = array();
/* CLASSES PHP : automatic include : */
/* PHP CLASSES : automatic include : */
foreach (glob($root . "class/m_*.php") as $di) {
if (preg_match("#${root}class/m_(.*)\\.php$#", $di, $match)) { // $
$classes[] = $match[1];
require_once($di);
}
}
/* THE DEFAULT CLASSES ARE :
dom, ftp, mail, quota, bro, admin, mem, mysql, err, variables
dom, ftp, mail, quota, bro, admin, mem, mysql, messages, variables
*/
// Load file for the system class.
@ -160,7 +146,7 @@ foreach (glob($root . "class/class_system_*.php") as $fcs) {
require_once($fcs);
}
/* Language */
/* Language environment setup */
include_once("lang_env.php");
$mem = new m_mem();
@ -181,9 +167,10 @@ if ((variable_get('force_https', '0', "This variable is set to 0 (default) if us
}
}
// CHECK CSRF for ALL POSTS :
// you MUST add csrf_get(); after ALL <form method="post"> in AlternC !
/**
* Check csrf token for all posts:
* you MUST add csrf_get(); after ALL <form method="post"> in AlternC !
*/
$fatalcsrf=false;
if (count($_POST) && !defined("NOCSRF")) {
if (csrf_check()<=0) {
@ -192,7 +179,7 @@ if (count($_POST) && !defined("NOCSRF")) {
}
}
/* Check the User identity (if required) */
/* Check the User identity (if not disabled) */
if (!defined('NOCHECK')) {
if (!$mem->checkid()) {
if (!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) {
@ -241,6 +228,7 @@ if ((variable_get('sql_max_username_length', NULL)==NULL)||(variable_get('sql_ma
}
if ($fatalcsrf) {
require_once("main.php");
exit();

View File

@ -1,14 +1,6 @@
<?php
/*
$Id: config_nochk.php,v 1.2 2004/11/04 06:56:49 anonymous Exp $
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2002 by the AlternC Development Team.
http://alternc.org/
----------------------------------------------------------------------
Based on:
Valentin Lacambre's web hosting softwares: http://altern.org/
----------------------------------------------------------------------
LICENSE
@ -24,11 +16,9 @@
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
Original Author of file: Benjamin Sonntag
Purpose of file: General configuration file for AlternC Desktop
----------------------------------------------------------------------
*/
define('NOCHECK', 1);
require_once("config.php");

View File

@ -1,13 +1,29 @@
<?php
/*
----------------------------------------------------------------------
LICENSE
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License (GPL)
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
*/
/**
* Mysql Database class
*
* François - aka fser - Serman
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*
* 2014/06/24
*/
class DB_Sql {
/* public: connection parameters */
@ -31,17 +47,16 @@ class DB_Sql {
private $Errno;
private $Error;
/* private: link and query handles */
private $Query_String;
/* PDO related variables */
private $pdo_instance = NULL;
private $pdo_query = NULL;
/**
* Constructor
* Constructor: Connect to the database server
*/
function __construct($db, $host, $user, $passwd) {
@ -55,6 +70,7 @@ class DB_Sql {
}
}
/**
* function for MySQL database connection management
*
@ -102,13 +118,17 @@ class DB_Sql {
$this->pdo_query->closeCursor();
}
function is_connected() {
return $this->pdo_instance != FALSE;
}
function last_error() {
return $this->Error;
}
/**
* Perform a query
*
@ -169,6 +189,7 @@ class DB_Sql {
return TRUE;
}
/**
* walk result set
@ -198,7 +219,10 @@ class DB_Sql {
return TRUE;
}
/* public: table locking */
/**
* table locking
*/
function lock($table, $mode="write") {
if (!$this->is_connected())
return FALSE;
@ -227,6 +251,9 @@ class DB_Sql {
}
/**
* table unlocking
*/
function unlock() {
if (!$this->is_connected())
return FALSE;
@ -238,11 +265,12 @@ class DB_Sql {
}
/* public: evaluate the result (size, width) */
/**
* evaluate the result (size, width)
*/
function affected_rows() {
return $this->pdo_query->rowCount();
}
function num_rows() {
return $this->pdo_query->rowCount();
}
@ -251,7 +279,9 @@ class DB_Sql {
return $this->pdo_query->columnCount();
}
/* public: shorthand notation */
/**
* shorthand notation
*/
function nf() {
return $this->num_rows();
}
@ -260,6 +290,7 @@ class DB_Sql {
print $this->num_rows();
}
/**
* @param string $Name
* @return integer
@ -271,18 +302,22 @@ class DB_Sql {
return false;
}
function current_record() {
return $this->Record;
}
function p($Name) {
print $this->Record[$Name];
}
function lastid() {
return $this->pdo_instance->lastInsertId();
}
/**
* Escape a string to use it into a SQL PDO query
* @param string string to escape
@ -303,7 +338,9 @@ class DB_Sql {
}
/* public: sequence numbers */
/**
* get next sequence numbers
*/
function nextid($seq_name) {
if (!$this->is_connected())
return FALSE;
@ -345,14 +382,19 @@ class DB_Sql {
return $nextid;
}
/* public: return table metadata */
/**
* DEPRECATED return table metadata
*/
function metadata($table='',$full=false) {
global $msg;
$msg->raise("ERROR", 'Mysql', 'function is no longer implemented (metadata())');
return FALSE;
}
/* private: error handling */
/**
* private: error handling
*/
function halt($msg) {
if ($this->Halt_On_Error == "no")
return;
@ -363,6 +405,10 @@ class DB_Sql {
die("Session halted.");
}
/**
* private: error handling
*/
function haltmsg($msg) {
printf("</td></tr></table><b>Database error:</b> %s<br />\n", $msg);
printf("<b>MySQL Error</b>: %s (%s)<br />\n",
@ -370,6 +416,7 @@ class DB_Sql {
implode("\n", $this->Error));
}
function table_names() {
$this->query("SHOW TABLES");
$return = array();
@ -378,5 +425,6 @@ class DB_Sql {
return $return;
}
}
?>
} /* Class DB_Sql */

View File

@ -1,10 +1,6 @@
<?php
/*
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2000-2012 by the AlternC Development Team.
https://alternc.org/
----------------------------------------------------------------------
LICENSE
@ -20,10 +16,12 @@
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
Purpose of file: Miscellaneous functions globally used
----------------------------------------------------------------------
*/
/**
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
/**
* Format a field value for input or textarea :
*
@ -34,6 +32,7 @@ function fl($str) {
return str_replace("<", "&lt;", str_replace("\"", "&quot;", $str));
}
/**
* Check if a domain can be hosted on this server :
* Return a negative value in case of an error,
@ -93,6 +92,7 @@ function checkhostallow($domain, $dns) {
return -3; // DNS incorrect in the whois
}
/**
* Check that a domain can be hosted in that server,
* without DNS managment.
@ -125,6 +125,7 @@ function checkhostallow_nodns($domain) {
return 0;
}
/**
* Return the remote IP.
* If you are behind a proxy, use X_FORWARDED_FOR instead of REMOTE_ADDR
@ -134,6 +135,7 @@ function get_remote_ip() {
return getenv('REMOTE_ADDR');
}
/**
* Check that $url is a correct url (http:// or https:// or ftp://)
*
@ -162,6 +164,7 @@ function checkurl($url) {
return !$t;
}
/**
* Check that TXT domain is correct
*
@ -172,6 +175,7 @@ function checksubtxt($txt) {
return true;
}
/**
* Check that CNAME domain is correct
* @param string $cname
@ -197,6 +201,7 @@ function checkcname($cname) {
return true;
}
/**
* Check that $ip is a correct 4 Dotted ip
* @param string $ip
@ -207,6 +212,7 @@ function checkip($ip) {
return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
}
/**
* Check that $ip is a correct ipv6 ip
* @param string $ip
@ -217,6 +223,7 @@ function checkipv6($ip) {
return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
}
/**
* Check a login mail, cf http://www.bortzmeyer.org/arreter-d-interdire-des-adresses-legales.html
* @todo Check who is using that function and delete it when unused
@ -227,6 +234,7 @@ function checkloginmail($mail) {
return true;
}
/**
* Check an email address, use filter_var with emails, which works great ;)
* @todo check who is using that function and delete it when unused
@ -241,6 +249,7 @@ function checkmail($mail) {
}
}
/**
* Check that a domain name is fqdn compliant
* @param string $fqdn
@ -276,6 +285,7 @@ function checkfqdn($fqdn) {
return $ret;
}
/**
* @global m_mem $mem
* @param string $path
@ -307,6 +317,7 @@ function checkuserpath($path) {
return 0;
}
/**
* get the home of the user
*
@ -323,6 +334,7 @@ function getuserpath($user = null) {
return rtrim(ALTERNC_HTML, "/") . "/" . substr($user, 0, 1) . "/" . $user;
}
/**
* ECHOes checked="checked" only if the parameter is true
* useful for checkboxes and radio buttons
@ -342,6 +354,7 @@ function cbox($test, $echo = true) {
return $return;
}
/**
* ECHOes selected="selected" only if the parameter is true
* useful for checkboxes and radio buttons
@ -362,6 +375,7 @@ function selected($bool, $echo = TRUE) {
return $return;
}
/**
*
* @param boolean $test
@ -382,6 +396,7 @@ function ecif($test, $tr, $fa = "", $affiche = 1) {
return $retour;
}
/**
*
* @param string $str
@ -390,6 +405,7 @@ function __($str) {
echo _($str);
}
/**
*
* @param boolean $test
@ -404,6 +420,7 @@ function ife($test, $tr, $fa = "") {
return $fa;
}
/**
*
* @param int|string $size
@ -448,6 +465,7 @@ function format_size($size, $html = 0) {
}
}
/**
*
* @param int $hid
@ -457,6 +475,7 @@ function getlinkhelp($hid) {
return "(<a href=\"javascript:help($hid);\">?</a>)";
}
/**
*
* @param int $hid
@ -465,6 +484,7 @@ function linkhelp($hid) {
echo getlinkhelp($hid);
}
/**
*
* @param string $format
@ -490,6 +510,7 @@ function format_date($format, $date) {
return sprintf($format, $d, $m, $y, $h, $i, $hh, $am);
}
/**
* Strip slashes if needed :
* @param string $str
@ -503,11 +524,10 @@ function ssla($str) {
}
}
/* ----------------------------------------------------------------- */
/** Hashe un mot de passe en clair en MD5 avec un salt al<EFBFBD>atoire
* @param string $pass Mot de passe <EFBFBD> crypter (max 32 caract<EFBFBD>res)
* @return string Retourne le mot de passe crypt<EFBFBD>
/** Hashe a password using proper crypto function
* @param string $pass a cleartext password to hash
* @return string the hash
* @access private
*/
function _md5cr($pass, $salt = "") {
@ -521,6 +541,7 @@ function _md5cr($pass, $salt = "") {
return crypt($pass, $salt);
}
/** split mysql database name between username and custom database name
* @param string $dbname database name
* @return array returns username as first element, custom name as second
@ -531,7 +552,6 @@ function split_mysql_database_name($dbname) {
implode("_", array_slice($db_exploded_name, 1)));
}
/* ----------------------------------------------------------------- */
/** Echappe les caract<EFBFBD>res pouvant perturber un flux XML standard :
* @param string $string Chaine de caract<EFBFBD>re <EFBFBD> encoder en valeur xml.
@ -542,7 +562,6 @@ function xml_entities($string) {
return str_replace("<", "&lt;", str_replace(">", "&gt;", str_replace("&", "&amp;", $string)));
}
/* ----------------------------------------------------------------- */
/** Converti un nombre de mois en une chaine plus lisible
* @param integer $months Nombre de mois
@ -558,7 +577,6 @@ function pretty_months($months) {
}
}
/* ----------------------------------------------------------------- */
/** Fabrique un drop-down pour les dur<EFBFBD>es de comptes
* @name string $name Nom pour le composasnt
@ -589,6 +607,7 @@ function duration_list($name, $selected = 0) {
return $res;
}
/**
* select_values($arr,$cur) echo des <option> du tableau $values ou de la table sql $values
* selectionne $current par defaut.
@ -613,17 +632,18 @@ function eoption($values, $cur, $onedim = false) {
}
}
/**
/* Echo the HTMLSpecialChars version of a value.
* Must be called when pre-filling fields values in forms such as :
* <input type="text" name="toto" value="<?php ehe($toto); ?>" />
* Use the charset of the current language for transcription
*
* @global string $charset
* @param string $str
* @param boolean $affiche
* @return string
*/
* Echo the HTMLSpecialChars version of a value.
* Must be called when pre-filling fields values in forms such as :
* <input type="text" name="toto" value="<?php ehe($toto); ?>" />
* Use the charset of the current language for transcription
*
* @global string $charset
* @param string $str
* @param boolean $affiche
* @return string
*/
function ehe($str, $affiche = TRUE) {
global $charset;
$retour = htmlspecialchars($str, ENT_QUOTES|ENT_SUBSTITUTE, $charset);
@ -633,17 +653,18 @@ function ehe($str, $affiche = TRUE) {
return $retour;
}
/**
/* Echo the URLENCODED version of a value.
* Must be called when pre-filling fields values in URLS such as :
* document.location='logs_tail.php?file=<?php eue($file); ?>
* Use the charset of the current language for transcription
*
* @global string $charset
* @param string $str
* @param boolean $affiche
* @return string
*/
* Echo the URLENCODED version of a value.
* Must be called when pre-filling fields values in URLS such as :
* document.location='logs_tail.php?file=<?php eue($file); ?>
* Use the charset of the current language for transcription
*
* @global string $charset
* @param string $str
* @param boolean $affiche
* @return string
*/
function eue($str, $affiche = TRUE) {
global $charset;
$retour = urlencode($str);
@ -653,11 +674,10 @@ function eue($str, $affiche = TRUE) {
return $retour;
}
/* Get the Fields of the posted form from $_REQUEST or POST or GET
* and check their type
*/
/**
* Get the Fields of the posted form from $_REQUEST or POST or GET
* and check their type
*
* @param array $fields
* @param boolean $requestOnly
@ -707,6 +727,7 @@ function getFields($fields, $requestOnly = false) {
return $vars;
}
/**
*
* @param array $array
@ -717,6 +738,7 @@ function printVar($array) {
echo "</pre>\n";
}
/**
*
* @param array $a
@ -730,10 +752,10 @@ function list_properties_order($a, $b) {
return ($a['label'] < $b['label']) ? -1 : 1;
}
/**
* Shows a pager : Previous page 0 1 2 ... 16 17 18 19 20 ... 35 36 37 Next page
*
*
* Arguments are as follow :
* $offset = the current offset from 0
* $count = The number of elements shown per page
@ -845,6 +867,7 @@ function pager($offset, $count, $total, $url, $before = "", $after = "", $echo =
return $return;
}
/**
* Create a password compatible with the password policy
* @param int $length
@ -885,6 +908,7 @@ function create_pass($length = 10, $classcount = 3) {
return $password;
}
/**
* Show a button to set a random password for a password field.
*
@ -903,6 +927,7 @@ function display_div_generate_password($pass_size = DEFAULT_PASS_SIZE, $fields_t
return 0;
}
/**
* Show a button to select a folder on the server
*
@ -950,6 +975,7 @@ function display_browser($dir = "", $caller = "main.dir", $width = 350, $height
";
}
/**
* Converts HSV to RGB values
* -----------------------------------------------------
@ -1048,6 +1074,7 @@ function fHSVtoRGB($iH, $iS, $iV) {
return array('r' => round($dR), 'g' => round($dG), 'b' => round($dB));
}
/**
*
* @param int $hex
@ -1058,6 +1085,7 @@ function hexa($hex) {
return (strlen("$num") >= 2) ? "$num" : "0$num";
}
/**
*
* @param int $p
@ -1079,6 +1107,7 @@ function PercentToColor($p = 0) {
return $color;
}
/**
*
* @global m_messages $msg
@ -1094,6 +1123,7 @@ function panel_lock() {
return touch(ALTERNC_LOCK_PANEL);
}
/**
*
* @global m_messages $msg
@ -1109,6 +1139,7 @@ function panel_unlock() {
return unlink(ALTERNC_LOCK_PANEL);
}
/**
*
* @return boolean
@ -1139,6 +1170,7 @@ function csrf_get($return=false) {
return true;
}
/** Check a CSRF token against the current session
* a token can be only checked once, it's disabled then
* @param $token string the token to check in the DB + session

View File

@ -1,6 +1,7 @@
<?php
/*
----------------------------------------------------------------------
LICENSE
This program is free software; you can redistribute it and/or
@ -15,9 +16,6 @@
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
Original Author of file: Lerider Steven
Purpose of file: Manage generic actions.
----------------------------------------------------------------------
*/
/**
@ -25,23 +23,13 @@
* It primary use is to store the actions to be performed ( creating file or folder, deleting, setting permissions etc..) in the action sql table.
* The script /usr/lib/alternc/do_actions.php handled by cron and incron is then used to perform those actions.
*
* Copyleft {@link http://alternc.org/ AlternC Team}
*
* @copyright AlternC-Team 2013-8-13 http://alternc.org/
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_action {
/* --------------------------------------------------------------------------- */
/**
* Constructor
*/
function m_action() {
}
/**
* Plans the cration of a file
* Tell the incron that an action should be performed
*
* @global m_messages $msg
* @global string $L_INOTIFY_DO_ACTION
@ -56,6 +44,7 @@ class m_action {
return TRUE;
}
/**
* Plans a file creation
*
@ -68,6 +57,7 @@ class m_action {
return $this->set('create_file', $user, array('file' => $file, 'content' => $content));
}
/**
* Plans the a chmod on file or dir
*
@ -80,6 +70,7 @@ class m_action {
return $this->set('chmod', $user, array('filename' => $filename, "perms" => $perms));
}
/**
* Plans the creation of a dir
*
@ -91,6 +82,7 @@ class m_action {
return $this->set('create_dir', $user, array('dir' => $dir));
}
/**
* Plans a perms fix upon user creation
* @param int $uid
@ -101,8 +93,9 @@ class m_action {
return $this->set('fix_user', $user, array('uid' => $uid));
}
/**
* Plans a dir fix
* Plans a dir permission fix
*
* @param string $dir
* @param m_user $user
@ -112,8 +105,9 @@ class m_action {
return $this->set('fix_dir', $user, array('dir' => $dir));
}
/**
* Plans a file fix
* Plans a file permission fix
*
* @param string $file
* @param m_user $user
@ -123,6 +117,7 @@ class m_action {
return $this->set('fix_file', $user, array('file' => $file));
}
/**
* function to delete file / folder
*
@ -134,6 +129,7 @@ class m_action {
return $this->set('delete', $user, array('dir' => $dir));
}
/**
* function returning the first not locked line of the action table
*
@ -146,6 +142,7 @@ class m_action {
return $this->set('move', $user, array('src' => $src, 'dst' => $dst));
}
/**
*
* function archiving a directory ( upon account deletion )
@ -182,8 +179,8 @@ class m_action {
return true;
}
/**
* @TODO: This has to be escaped
* function inserting the action in the sql table
*
* @global m_mysql $db
@ -218,6 +215,7 @@ class m_action {
return $this->do_action();
}
/**
* This seems to be unused ?
*
@ -237,6 +235,7 @@ class m_action {
return $db->num_rows($result);
}
/**
*
* @global m_messages $msg
@ -259,6 +258,7 @@ class m_action {
return $db->num_rows($result);
}
/**
* function returning the first not locked line of the action table
*
@ -278,6 +278,7 @@ class m_action {
}
}
/**
* function locking an entry while it is being executed by the action script
*
@ -295,6 +296,7 @@ class m_action {
return true;
}
/**
* function locking an entry while it is being executed by the action script
*
@ -313,6 +315,7 @@ class m_action {
return true;
}
/**
*
* @global m_mysql $db
@ -329,6 +332,7 @@ class m_action {
return true;
}
/**
* Returns a list of actions marked as executable and ready for execution
*
@ -348,6 +352,7 @@ class m_action {
}
}
/**
* function locking an entry while it is being executed by the action script
*
@ -360,6 +365,5 @@ class m_action {
return true;
}
}
} /* Class action */
/* Class action */

View File

@ -1,10 +1,6 @@
<?php
/*
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2000-2012 by the AlternC Development Team.
https://alternc.org/
----------------------------------------------------------------------
LICENSE
@ -20,23 +16,21 @@
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
Purpose of file: Administrate members and rights.
----------------------------------------------------------------------
*/
/* ----------------------------------------------------------------- */
/**
* Manage the AlternC's account administration (create/edit/delete)
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_admin {
/* ----------------------------------------------------------------- */
/** $enabled tells if the logged user is super-admin or not
/**
* $enabled tells if the logged user is super-admin or not
*/
var $enabled = 0;
/* ----------------------------------------------------------------- */
/** List of the controls made for each TLD
*
@ -46,13 +40,14 @@ class m_admin {
public $tldmode = array();
var $archive = '';
/**
* Constructor
*
* @global type $db
* @global type $cuid
*/
function m_admin() {
function __construct() {
global $db, $cuid;
$db->query("SELECT su FROM membres WHERE uid=?;", array($cuid));
$db->next_record();
@ -69,8 +64,9 @@ class m_admin {
$this->archive = variable_get('archive_del_data', '', 'If folder specified html folder of deleted user is archived, else it is deleted. ');
}
/**
*
* Hook function called by the menu class to add menu to the left panel.
* @global type $mem
* @global type $cuid
* @global type $debug_alternc
@ -140,6 +136,7 @@ class m_admin {
return $obj;
}
/**
* Password kind used in this class (hook for admin class)
*
@ -149,6 +146,7 @@ class m_admin {
return array("adm" => "Administration section");
}
/**
*
*/
@ -161,6 +159,7 @@ class m_admin {
}
}
/**
* return the uid of an alternc account
*
@ -177,6 +176,7 @@ class m_admin {
return $db->f('uid');
}
/**
* return the name of an alternc account
*
@ -193,6 +193,7 @@ class m_admin {
return $db->f('login');
}
/**
* Returns the known information about a hosted account
*
@ -254,6 +255,7 @@ class m_admin {
return $lst_users_properties[$uid];
}
/**
* Returns the known information about a specific hosted account
*
@ -303,6 +305,7 @@ class m_admin {
return $c;
}
/**
*
* @global type $db
@ -316,6 +319,7 @@ class m_admin {
return ($db->f("cnt") == 1);
}
/**
* @TODO :EM: those request should have been escaped
* Returns the list of the hosted accounts
@ -406,6 +410,7 @@ class m_admin {
}
}
/**
* Send an email to all AlternC's accounts
*
@ -449,6 +454,7 @@ class m_admin {
return true;
}
/**
* Returns an array with the known information about resellers (uid, login, number of accounts)
* Does not include account 2000 in the list.
@ -485,6 +491,7 @@ class m_admin {
return $creators2;
}
/**
* Check if I am the creator of the member $uid
*
@ -509,6 +516,7 @@ class m_admin {
return true;
}
/**
* When the admin want to delegate a subdomain to an account
*
@ -551,7 +559,6 @@ class m_admin {
return true;
}
/* ----------------------------------------------------------------- */
/** Creates a new hosted account
*
@ -668,6 +675,7 @@ class m_admin {
}
}
/**
* AlternC's standard function called when a user is created
* This sends an email if configured through the interface.
@ -727,6 +735,7 @@ class m_admin {
}
}
/**
* Edit an account
*
@ -789,6 +798,7 @@ class m_admin {
}
}
/**
* Lock an account
*
@ -815,6 +825,7 @@ class m_admin {
}
}
/**
* UnLock an account
*
@ -842,7 +853,6 @@ class m_admin {
}
}
/* ----------------------------------------------------------------- */
/** Deletes an account
* Deletes the specified account. Prevents any manipulation of the account if
@ -896,6 +906,7 @@ class m_admin {
}
}
/**
* Renew an account
*
@ -922,6 +933,7 @@ class m_admin {
}
}
/**
* Update the duration information for an account
*
@ -949,6 +961,7 @@ class m_admin {
return false;
}
/**
* Get the expiry date for an account
*
@ -963,7 +976,6 @@ class m_admin {
return '';
}
/* ----------------------------------------------------------------- */
/**
* Get the expiry status for an account
@ -985,6 +997,7 @@ class m_admin {
return 0;
}
/**
* Get the expired/about to expire accounts.
*
@ -1011,6 +1024,7 @@ class m_admin {
}
}
/**
* Turns a common account into a super-admin account
*
@ -1034,6 +1048,7 @@ class m_admin {
return true;
}
/**
* Turns a super-admin account into a common account
*
@ -1057,6 +1072,7 @@ class m_admin {
return true;
}
/**
* List of the authorized TLDs
* Returns the list of the authorized TLDs and also the way they are
@ -1080,6 +1096,7 @@ class m_admin {
return $c;
}
/**
* List the hosted domains on this server
*
@ -1124,6 +1141,7 @@ class m_admin {
return $c;
}
/**
* Check all the domains for their NS MX and IPs
*
@ -1221,6 +1239,7 @@ class m_admin {
return $checked;
}
/**
* Lock / Unlock a domain
*
@ -1243,6 +1262,7 @@ class m_admin {
return true;
}
/**
* Add a new TLD to the list of the authorized TLDs
*
@ -1261,6 +1281,7 @@ class m_admin {
return $db->Record["mode"];
}
/**
* Prints the list of the actually authorized TLDs
*
@ -1276,6 +1297,7 @@ class m_admin {
}
}
/**
* Deletes the specified tld in the list of the authorized TLDs
* <b>Note</b> : This function does not delete the domains depending
@ -1298,7 +1320,6 @@ class m_admin {
return true;
}
/* ----------------------------------------------------------------- */
/** Add a TLD to the list of the authorized TLDs during the installation
*
@ -1337,6 +1358,7 @@ class m_admin {
return true;
}
/**
* Modify a TLD of the list of the authorized TLDs
*
@ -1363,6 +1385,7 @@ class m_admin {
return true;
}
/**
* Get the login name of the main administrator account
*
@ -1376,6 +1399,7 @@ class m_admin {
return $db->f("login");
}
/**
* List the password policies currently installed in the policy table
*
@ -1418,6 +1442,7 @@ class m_admin {
return $policies;
}
/**
* Change a password policy for one kind of password
*
@ -1448,6 +1473,7 @@ class m_admin {
return true;
}
/**
*
* @global m_mysql $db
@ -1529,7 +1555,6 @@ class m_admin {
}
}
} /* Class m_admin */
/* Classe ADMIN */

View File

@ -1,7 +1,6 @@
<?php
/**
$Id: m_authip.php
/*
----------------------------------------------------------------------
LICENSE
@ -17,16 +16,16 @@
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
Original Author of file: Fufroma
----------------------------------------------------------------------
*/
/**
* Classe de gestion des IP authorisée
* @group alternc
* */
* Authorized-ip class
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_authip {
/**
* Retourne la liste des ip whitelist
*
@ -41,6 +40,7 @@ class m_authip {
return $this->list_ip(true);
}
/**
*
* @return array
@ -56,6 +56,7 @@ class m_authip {
return $obj;
}
/**
* Retourne la liste des ip spécifiées par cet utilisateur
*
@ -89,6 +90,7 @@ class m_authip {
return $r;
}
/**
* Supprime une IP des IP de l'utilisateur
* et supprime les droits attaché en cascade
@ -116,6 +118,7 @@ class m_authip {
return true;
}
/**
* Liste les IP et subnet authorisés
* pour une classe donnée
@ -138,6 +141,7 @@ class m_authip {
return $r;
}
/**
*
* @global m_mysql $db
@ -157,6 +161,7 @@ class m_authip {
return false;
}
/**
* Retourne si l'ip appartient au subnet.
*
@ -176,6 +181,7 @@ class m_authip {
return false;
}
/**
* Sauvegarde une IP dans les IP TOUJOURS authorisée
*
@ -189,6 +195,7 @@ class m_authip {
return $this->ip_save($id, $ipsub, $infos, 0);
}
/**
* Sauvegarde une IP dans les IP authorisée
*
@ -265,6 +272,7 @@ class m_authip {
return true;
}
/**
* Fonction appelée par Alternc lors de la suppression d'un utilisateur
*
@ -281,6 +289,7 @@ class m_authip {
return true;
}
/**
* Analyse les classes et récupéres les informations
* des classes voulant de la restriction IP
@ -300,6 +309,7 @@ class m_authip {
return $authclass;
}
/**
* Enregistre ou modifie une affectation ip<=>ressource
* Nota : lance des hooks sur la classe correspondante pour
@ -334,6 +344,7 @@ class m_authip {
return true;
}
/**
* Supprime une affectation ip<=>ressource
* Nota : lance des hooks dans la classe correspondante
@ -357,6 +368,7 @@ class m_authip {
return true;
}
/**
* Appel les hooks demandé avec en parametres les
* affectationt ip<=>ressource dont l'id est en parametre
@ -393,6 +405,7 @@ class m_authip {
return true;
}
/**
* Liste les affectation ip<=>ressource d'un utilisateur
*
@ -416,6 +429,5 @@ class m_authip {
return $r;
}
}
} /* Class m_authip */
/* Classe m_authip */

View File

@ -1,10 +1,6 @@
<?php
/*
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2000-2012 by the AlternC Development Team.
https://alternc.org/
----------------------------------------------------------------------
LICENSE
@ -20,8 +16,6 @@
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
Purpose of file: file browser class.
----------------------------------------------------------------------
*/
/* Add the mime type list */
@ -30,6 +24,8 @@
/**
* This class manage the file browser of AlternC
* allow the file and directory management in the user account web folder
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_bro {
@ -45,20 +41,10 @@ class m_bro {
/** What do we do after creating a file? */
var $l_createfile;
/** internal cache
*/
/** internal cache */
var $mime_desc = array();
/** internal cache
*/
var $mime_icon = array();
/** internal cache
*/
var $mime_type = array();
/** Internal cache for viewurl
*/
var $cacheurl = array();
/** Font choice in the editor */
@ -67,6 +53,7 @@ class m_bro {
/** font size in the editor */
var $l_editor_size = array("18px", "14px", "12px", "10px", "8px", "0.8em", "0.9em", "1em", "1.1em", "1.2em");
/**
* Constructor
* */
@ -77,8 +64,9 @@ class m_bro {
$this->l_createfile = array(0 => _("Go back to the file manager"), 1 => _("Edit the newly created file"));
}
/**
*
* Hook called by the menu class to add menus to the left panel
* @return array
*/
function hook_menu() {
@ -92,6 +80,7 @@ class m_bro {
return $obj;
}
/**
* Verifie un dossier relatif au dossier de l'utilisateur courant
*
@ -142,6 +131,7 @@ class m_bro {
}
}
/**
* Retourne le chemin complet vers la racine du repertoire de l'utilisateur.
*
@ -154,6 +144,7 @@ class m_bro {
return getuserpath();
}
/**
* Retourne le chemin complet vers la racine du repertoire de l'utilisateur.
* Returns the complete path to the root of the user's directory.
@ -177,6 +168,7 @@ class m_bro {
return $this->get_user_root($member['login']);
}
/**
* Retourne un tableau contenant la liste des fichiers du dossier courant
*
@ -223,6 +215,7 @@ class m_bro {
return $c;
}
/**
* Retourne un tableau contenant les prfrences de l'utilisateur courant
*
@ -244,6 +237,7 @@ class m_bro {
return $db->Record;
}
/**
Modifie les prfrences de l'utilisateur courant.
*
@ -279,6 +273,7 @@ class m_bro {
return true;
}
/**
* Retourne le nom du fichier icone associ au fichier donc le nom est $file
* <b>Note</b>: Les fichiers icones sont mis en cache sur la page courante.
@ -306,6 +301,7 @@ class m_bro {
}
}
/**
* Retourne le type mime associé au fichier donc le nom est $file
* <b>Note</b>: Les types mimes sont mis en cache sur la page courante.
@ -334,6 +330,7 @@ class m_bro {
}
}
/**
* Retourne la taille du fichier $file
* si $file est un dossier, retourne la taille de ce dossier et de tous
@ -356,6 +353,7 @@ class m_bro {
}
}
/**
* Returns the size of a directory, by adding all it's files sizes
*
@ -382,6 +380,7 @@ class m_bro {
return $totalsize;
}
/**
* Crée le dossier $file dans le dossier (parent) $dir
*
@ -409,6 +408,7 @@ class m_bro {
}
}
/**
* Crée un fichier vide dans un dossier
*
@ -437,6 +437,7 @@ class m_bro {
return true;
}
/**
* Efface les fichiers du tableau $file_list dans le dossier $R
*
@ -463,6 +464,7 @@ class m_bro {
return true;
}
/**
* Renomme les fichier de $old du dossier $R en $new
*
@ -496,6 +498,7 @@ class m_bro {
return true;
}
/**
* Déplace les fichier de $d du dossier $old vers $new
*
@ -537,6 +540,7 @@ class m_bro {
return true;
}
/**
* Change les droits d'acces aux fichier de $d du dossier $R en $p
*
@ -574,6 +578,7 @@ class m_bro {
return true;
}
/**
* Recoit un champ file upload (Global) et le stocke dans le dossier $R
* Le champ file-upload originel doit s'appeler "userfile" et doit
@ -630,6 +635,7 @@ class m_bro {
return $absolute . "/" . $_FILES['userfile']['name'];
}
/**
* Extract an archive by using GNU and non-GNU tools
*
@ -689,6 +695,7 @@ class m_bro {
return true;
}
/**
* Copy many files from point A to point B
*
@ -723,6 +730,7 @@ class m_bro {
return true;
}
/**
* Copy a source to a destination by either copying recursively a
* directory or by downloading a file with a URL (only http:// is
@ -745,6 +753,7 @@ class m_bro {
return true;
}
/**
* Affiche le chemin et les liens de la racine au dossier $path
* Affiche autant de liens HTML (anchor) que le chemin $path contient de
@ -776,6 +785,7 @@ class m_bro {
return $c;
}
/**
* Affiche le contenu d'un fichier pour un champ VALUE de textarea
*
@ -806,6 +816,7 @@ class m_bro {
}
}
/**
* Retourne une url de navigation pour le fichier $name du dossier $dir
* Les url sont mises en caches. Il se peut qu'aucune url n'existe, ou que
@ -865,6 +876,7 @@ class m_bro {
}
}
/**
*
* @global m_mem $mem
@ -892,6 +904,7 @@ class m_bro {
return false;
}
/**
* Return a HTML snippet representing an extraction function only if the mimetype of $name is supported
*
@ -922,6 +935,7 @@ class m_bro {
return false;
}
/**
* return true if file is a sql dump (end with .sql or .sql.gz)
*
@ -940,6 +954,7 @@ class m_bro {
return false;
}
/**
*
* @global m_messages $msg
@ -955,6 +970,7 @@ class m_bro {
$this->content_send($dir, $file);
}
/**
* Echoes the content of the file $file located in directory $R
*
@ -977,6 +993,7 @@ class m_bro {
}
}
/**
* Sauve le fichier $file dans le dossier $R avec pour contenu $texte
* le contenu est issu d'un textarea, et ne DOIT PAS contenir de \ ajouts
@ -1007,6 +1024,7 @@ class m_bro {
return true;
}
/**
* Echo d'un flux .tar.Z contenant tout le contenu du dossier $dir
*
@ -1024,6 +1042,7 @@ class m_bro {
passthru("/bin/tar -cZ -C " . getuserpath() . "/" . $mem->user["login"] . "/ $d");
}
/**
* Echo d'un flux .tgz contenant tout le contenu du dossier $dir
*
@ -1041,6 +1060,7 @@ class m_bro {
passthru("/bin/tar -cz -C " . getuserpath() . "/ $d");
}
/**
* Echo d'un flux .tar.bz2 contenant tout le contenu du dossier $dir
*
@ -1058,6 +1078,7 @@ class m_bro {
passthru("/bin/tar -cj -C " . getuserpath() . "/ $d");
}
/**
* Echo d'un flux .ZIP contenant tout le contenu du dossier $dir
*
@ -1076,6 +1097,7 @@ class m_bro {
passthru("/usr/bin/zip -r - ".escapeshellarg(basename($d)));
}
/**
* Fonction de tri perso utilis par filelist.
*
@ -1094,6 +1116,7 @@ class m_bro {
return $a["name"] > $b["name"];
}
/**
* Efface $file et tous ses sous-dossiers s'il s'agit d'un dossier
* A UTILISER AVEC PRECAUTION !!!
@ -1127,6 +1150,7 @@ class m_bro {
}
}
/**
* Function d'exportation de configuration appelé par la classe m_export via un hooks
* Produit en sorti un tableau formatté ( pour le moment) en HTML
@ -1154,6 +1178,7 @@ class m_bro {
return $str;
}
/**
* Function d'exportation des données appelé par la classe m_export via un hooks
*
@ -1183,6 +1208,4 @@ class m_bro {
return min(ini_get('post_max_size'), ini_get('upload_max_filesize'));
}
}
/* Class Browser */
} /* Class m_bro */

View File

@ -1,10 +1,6 @@
<?php
/*
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2000-2012 by the AlternC Development Team.
https://alternc.org/
----------------------------------------------------------------------
LICENSE
@ -20,26 +16,22 @@
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
Purpose of file: Manage hook system.
----------------------------------------------------------------------
*/
/**
* This class manage web-cron tasks
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_cron {
const MAX_SOCKETS = 8;
const DEFAULT_CAFILE = "/etc/ssl/certs/ca-certificates.crt";
/* --------------------------------------------------------------------------- */
/** Constructor
/**
*
*/
function m_cron() {
}
function schedule() {
return Array(
Array('unit' => 1440, 'name' => _("Daily")),
@ -48,9 +40,9 @@ class m_cron {
);
}
/* --------------------------------------------------------------------------- */
/** List the crontab for the current user.
/**
* List the crontab for the current user.
* @return array an hash for each crontab.
*/
function lst_cron() {
@ -72,6 +64,9 @@ class m_cron {
return $r;
}
/**
* Hook called by menu class to add menu to the left panel
*/
function hook_menu() {
$obj = array(
'title' => _("Scheduled tasks"),
@ -83,9 +78,9 @@ class m_cron {
return $obj;
}
/* --------------------------------------------------------------------------- */
/** update the crontab
/**
* update the crontab
* @param $arr array the crontab information, including its ID
* @return boolean TRUE if the crontab has been edited
*/
@ -105,9 +100,9 @@ class m_cron {
return $ok;
}
/* --------------------------------------------------------------------------- */
/** delete a crontab
/**
* delete a crontab
* @param $id the id of the crontab to delete
* @return boolean TRUE if the crontab has been deleted
*/
@ -117,9 +112,9 @@ class m_cron {
return $db->query("DELETE FROM cron WHERE id= ? AND uid= ? LIMIT 1;", array(intval($id), $cuid));
}
/* --------------------------------------------------------------------------- */
/** update a crontab,
/**
* update a crontab,
* @return boolean TRUE if the crontab has been edited
*/
private function _update_one($url, $user, $password, $email, $schedule, $id = null) {
@ -171,9 +166,9 @@ class m_cron {
return $db->query("REPLACE INTO cron (id, uid, url, user, password, schedule, email) VALUES (?, ?, ?, ?, ?, ?, ?) ;" , array($id, $cuid, $url, $user, $password, $schedule, $email));
}
/* --------------------------------------------------------------------------- */
/** validate a crontab schedule
/**
* validate a crontab schedule
* @param $s array schedule paramters
* @return boolean TRUE if the schedule is valid
*/
@ -191,9 +186,9 @@ class m_cron {
return $r;
}
/* --------------------------------------------------------------------------- */
/** hook for quota computation
/**
* hook for quota computation
*/
function hook_quota_get() {
global $cuid, $db, $msg;
@ -206,7 +201,6 @@ class m_cron {
return $q;
}
/* --------------------------------------------------------------------------- */
/**
* Execute the required crontab of AlternC users
@ -252,7 +246,6 @@ class m_cron {
}
}
/* --------------------------------------------------------------------------- */
/**
* Callback function called by rolling_curl when a cron resulr has been received
@ -279,7 +272,6 @@ class m_cron {
$db->query("UPDATE cron SET next_execution=FROM_UNIXTIME( UNIX_TIMESTAMP(NOW()) + schedule * 60) WHERE id= ?", array($id));
}
/* --------------------------------------------------------------------------- */
/**
* Launch parallel (using MAX_SOCKETS sockets maximum) retrieval
@ -398,6 +390,4 @@ class m_cron {
return true;
}
}
/* Class cron */
} /* Class cron */

View File

@ -19,9 +19,9 @@
*/
/**
* This class manage debug.
* This class manage debug. Available to admin account only
*
* @copyright AlternC-Team 2002-2005 http://alternc.org/
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_debug_alternc {

View File

@ -25,6 +25,8 @@ define('SLAVE_FLAG', "/var/run/alternc/refresh_slave");
*
* Cette classe permet de gérer les domaines / sous-domaines, redirections
* dns et mx des domaines d'un membre hébergé.<br />
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_dom {

View File

@ -19,7 +19,11 @@
/**
* Classe de gestion des erreurs apparaissant lors d'appels API.
*
*
* =================================================================
* DEPRECATION WARNING: DON'T USE THIS CLASS, USE M_MESSAGES INSTEAD
* =================================================================
*
* <p>Cette classe gère les erreurs qui peuvent apparaitre lors d'appels
* à l'API d'AlternC. Ces erreurs sont stockées sous la forme de 2 nombres
* (Classe ID et Numéro d'erreur) ainsi qu'un texte facultatif associé.

View File

@ -20,6 +20,8 @@
/**
* FTP account management class
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_ftp {

View File

@ -19,8 +19,10 @@
*/
/**
* This class manage hooks.
* This class manage hooks that any other class or panel page can call.
* or hook to.
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_hooks {

View File

@ -22,6 +22,7 @@
* This class handle folder web restricted access through .htaccess/.htpassword
* files.
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_hta {

View File

@ -20,6 +20,8 @@
/**
* This class shows error or access logs of web server to the web panel
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_log {

View File

@ -21,8 +21,9 @@
include_once(dirname(__FILE__) . '/vm.class.php');
/**
* Manage AlternC's virtual machine (Containers) start/stop using our own inetd-based protocol.
*
* Manage AlternC's virtual machine start/stop using our own inetd-based protocol.
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_lxc implements vm {

View File

@ -26,6 +26,8 @@
* address = any used email address will be defined here, mailbox = pop/imap mailboxes, recipient = redirection from an email to another
* and indirectly the domain class, to know domain names from their id in the DB.
* This class is also defining a few hooks, search ->invoke in the code.
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_mail {

View File

@ -22,8 +22,8 @@
* This class manage user sessions in the web desktop.
*
* This class manage user sessions and administration in AlternC.
* @copyright AlternC-Team 2002-2005 http://alternc.org/
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_mem {

View File

@ -21,7 +21,7 @@
/**
* This class manage the left menu of AlternC
*
* @copyright AlternC-Team 2002-2005 http://alternc.org/
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_menu {

View File

@ -28,7 +28,7 @@
* system in /var/log/alternc/bureau.log
* </p>
*
* @copyright AlternC-Team https://alternc.com/
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_messages {

View File

@ -22,7 +22,7 @@
* MySQL user database management for AlternC.
* This class manage user's databases in MySQL, and user's MySQL accounts.
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class DB_users extends DB_Sql {

View File

@ -20,6 +20,8 @@
/**
* This class manage piwik statistics management through AlternC, using piwik's "API".
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_piwik {
var $piwik_server_uri;

View File

@ -29,6 +29,7 @@
* each class may also export a function <code>alternc_quota_names()</code>
* that returns an array with the quotas names managed by this class.
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
class m_quota {

View File

@ -20,6 +20,7 @@
/**
* Browser mime function to detect mime types and show icons or type names
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
if (!IsSet($MIME_H)) {
$MIME_H = 1;