Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
domainepublic
alternc
Commits
7cd158c4
Commit
7cd158c4
authored
Mar 26, 2014
by
fufroma
Browse files
Suggested comments
parent
1c7ee907
Changes
21
Hide whitespace changes
Inline
Side-by-side
awstats/bureau/class/m_aws.php
View file @
7cd158c4
...
...
@@ -537,6 +537,10 @@ class m_aws {
/* ----------------------------------------------------------------- */
/**
* @param integer $id
*/
function
delete_allowed_login
(
$id
,
$noconf
=
0
)
{
global
$db
,
$err
,
$cuid
;
$err
->
log
(
"aws"
,
"delete_allowed_login"
);
...
...
@@ -633,7 +637,6 @@ class m_aws {
/**
* This function is called when we are asked to compute the used quota
* for a service
* @param integer $id The userid whose quota should be computed.
*/
function
hook_quota_get
()
{
global
$db
,
$err
,
$cuid
;
...
...
bureau/admin/browseforfolder2.php
View file @
7cd158c4
...
...
@@ -44,6 +44,10 @@ $fields = array (
);
getFields
(
$fields
);
/**
* @param integer $pos
* @param integer $level
*/
function
_subbrowse
(
$curdir
,
$pos
,
$level
)
{
global
$maxlevel
,
$root
,
$brlist
;
if
(
$level
>
$maxlevel
)
...
...
bureau/class/class_system_bind.php
View file @
7cd158c4
...
...
@@ -133,7 +133,6 @@ class system_bind {
/**
*
* @param string $domain
* @return string
*/
function
get_zone_header
()
{
...
...
@@ -177,7 +176,7 @@ class system_bind {
* Generate the domain DKIM key
*
* @param string $domain
* @return boolean
* @return
null|
boolean
*/
function
dkim_generate_key
(
$domain
)
{
// Stop here if we do not manage the mail
...
...
bureau/class/db_mysql.php
View file @
7cd158c4
...
...
@@ -51,14 +51,14 @@ class DB_Sql {
}
/**
* @return
th
e class variable Link_ID
* @return
resourc
e class variable Link_ID
*/
function
link_id
()
{
return
$this
->
Link_ID
;
}
/**
* @return
the
class variable Query_ID
* @return
integer
class variable Query_ID
*/
function
query_id
()
{
return
$this
->
Query_ID
;
...
...
@@ -289,6 +289,9 @@ class DB_Sql {
print
$this
->
num_rows
();
}
/**
* @param string $Name
*/
function
f
(
$Name
)
{
return
$this
->
Record
[
$Name
];
}
...
...
bureau/class/functions.php
View file @
7cd158c4
...
...
@@ -104,7 +104,7 @@ function checkhostallow($domain,$dns) {
* Check that a domain can be hosted in that server,
* without DNS managment.
* @global m_mysql $db
* @param
type
$domain
* @param
string
$domain
* @return int
*/
function
checkhostallow_nodns
(
$domain
)
{
...
...
@@ -340,7 +340,7 @@ function selected($bool, $echo = TRUE) {
* @param boolean $test
* @param string $tr
* @param string $fa
* @param
boolean
$affiche
* @param
integer
$affiche
* @return string
*/
function
ecif
(
$test
,
$tr
,
$fa
=
""
,
$affiche
=
1
)
{
...
...
@@ -381,7 +381,7 @@ function ife($test,$tr,$fa="") {
/**
*
* @param int|string $size
* @param
string
$html
* @param
integer
$html
* @return string
*/
function
format_size
(
$size
,
$html
=
0
)
{
...
...
@@ -512,7 +512,7 @@ function xml_entities($string) {
/* ----------------------------------------------------------------- */
/** Converti un nombre de mois en une chaine plus lisible
* @param
numb
er $months Nombre de mois
* @param
integ
er $months Nombre de mois
* @return string Cha�ne repr�sentant le nombre de mois
* @access private
*/
...
...
bureau/class/m_action.php
View file @
7cd158c4
...
...
@@ -94,7 +94,7 @@ class m_action {
*
* @param string $dir
* @param m_user $user
* @return
type
* @return
boolean
*/
function
fix_dir
(
$dir
,
$user
=
"root"
)
{
return
$this
->
set
(
'fix_dir'
,
$user
,
array
(
'dir'
=>
$dir
));
...
...
@@ -105,7 +105,7 @@ class m_action {
*
* @param string $file
* @param m_user $user
* @return
type
* @return
boolean
*/
function
fix_file
(
$file
,
$user
=
"root"
)
{
return
$this
->
set
(
'fix_file'
,
$user
,
array
(
'file'
=>
$file
));
...
...
@@ -116,7 +116,7 @@ class m_action {
*
* @param string $dir
* @param m_user $user
* @return
type
* @return
boolean
*/
function
del
(
$dir
,
$user
=
"root"
)
{
return
$this
->
set
(
'delete'
,
$user
,
array
(
'dir'
=>
$dir
));
...
...
@@ -128,7 +128,7 @@ class m_action {
* @param string $src
* @param string $dst
* @param m_user $user
* @return
type
* @return
boolean
*/
function
move
(
$src
,
$dst
,
$user
=
"root"
)
{
return
$this
->
set
(
'move'
,
$user
,
array
(
'src'
=>
$src
,
'dst'
=>
$dst
));
...
...
@@ -304,7 +304,7 @@ class m_action {
* @global m_mysql $db
* @global m_err $err
* @param int $id
* @param
type
$return
* @param
integer
$return
* @return boolean
*/
function
finish
(
$id
,
$return
=
0
)
{
...
...
bureau/class/m_admin.php
View file @
7cd158c4
...
...
@@ -258,7 +258,7 @@ class m_admin {
/* ----------------------------------------------------------------- */
/** @return
TRUE
if there's only ONE admin account
/** @return
boolean
if there's only ONE admin account
* @return boolean TRUE if there is only one admin account
* (allow the program to prevent the destruction of the last admin account)
*/
...
...
@@ -363,7 +363,7 @@ class m_admin {
* @param $subject string Subject of the email to send
* @param $message string Message to send
* @param $from string expeditor of that email.
* @return
true
if the mail has been successfully sent.
* @return
boolean
if the mail has been successfully sent.
*/
function
mailallmembers
(
$subject
,
$message
,
$from
)
{
global
$err
,
$mem
,
$cuid
,
$db
;
...
...
@@ -448,6 +448,10 @@ class m_admin {
}
// When the admin want to delegate a subdomain to an account
/**
* @param boolean $domain_name
*/
function
add_shared_domain
(
$u
,
$domain_name
)
{
global
$db
,
$err
,
$dom
,
$mem
,
$cuid
;
$err
->
log
(
"admin"
,
"add_shared_domain"
,
$u
.
"/"
.
$domain_name
);
...
...
@@ -812,7 +816,7 @@ EOF;
/* ----------------------------------------------------------------- */
/** Update the duration information for an account
* @param $uid integer the uid number of the account we want to update
* @param $duration integer the new duration, in months, of the account
* @param
integer
$duration integer the new duration, in months, of the account
* @return boolean Returns FALSE if an error occurs, TRUE if not.
*/
function
renew_update
(
$uid
,
$duration
)
{
...
...
@@ -894,7 +898,7 @@ EOF;
/** Turns a common account into a super-admin account
* @param $uid integer the uid number of the common account we want to turn into a
* super-admin account.
* @return
Returns
FALSE if an error occurs, TRUE if not.
* @return
boolean
FALSE if an error occurs, TRUE if not.
*/
function
normal2su
(
$uid
)
{
global
$err
,
$db
;
...
...
bureau/class/m_bro.php
View file @
7cd158c4
...
...
@@ -586,7 +586,7 @@ class m_bro {
* @param string $file is the full or relative path to the archive
* @param string $dest is the path of the extract destination, the
* same directory as the archive by default
* @return
boolean
!= 0 on error
* @return
integer|null
!= 0 on error
*/
function
ExtractFile
(
$file
,
$dest
=
null
)
{
global
$err
,
$cuid
,
$mem
,
$action
;
...
...
@@ -715,7 +715,7 @@ class m_bro {
* du fichier est reformat pour pouvoir entrer dans un champs TextArea
* @param string $R Dossier dans lequel on cherche le fichier
* @param string $file Fichier dont on souhaite obtenir le contenu.
* @return
boolean
retourne TRUE si le fichier a bien t mis sur
* @return
false|string
retourne TRUE si le fichier a bien t mis sur
* echo, ou FALSE si une erreur est survenue.
*/
function
content
(
$R
,
$file
)
{
...
...
@@ -892,7 +892,7 @@ class m_bro {
* cras sans confirmation.
* @param string $R Dossier dans lequel on modifie le fichier
* @param string $texte texte du fichier sauver dedans
* @return
boolean
TRUE si tout s'est bien pass, FALSE si une erreur s'est produite.
* @return
false|null
TRUE si tout s'est bien pass, FALSE si une erreur s'est produite.
*/
function
save
(
$file
,
$R
,
$texte
)
{
global
$err
;
...
...
bureau/class/m_hta.php
View file @
7cd158c4
...
...
@@ -141,7 +141,7 @@ class m_hta {
/**
* Tells if a folder is protected.
* @param string $dir Folder to check
* @return
TRUE
if the folder is protected, or FALSE if it is not
* @return
boolean
if the folder is protected, or FALSE if it is not
*/
function
is_protected
(
$dir
){
global
$mem
,
$err
;
...
...
@@ -221,7 +221,6 @@ class m_hta {
/*---------------------------------------------------------------------------*/
/**
* Add a user to a protected folder
* @param string $login The user login to add
* @param string $password The password to add (cleartext)
* @param string $dir The folder we add it to (relative to user root).
* @return boolean TRUE if the user has been added, or FALSE if an error occurred
...
...
bureau/class/m_mail.php
View file @
7cd158c4
...
...
@@ -157,6 +157,10 @@ class m_mail {
return
$this
->
delete
(
$catch
[
'mail_id'
]);
}
/**
* @param string $domain_id
* @param string $target
*/
function
catchall_set
(
$domain_id
,
$target
)
{
global
$err
;
// target :
...
...
@@ -427,7 +431,7 @@ ORDER BY
/** Hook called when the DOMAIN class will delete a domain.
*
* @param $dom integer the number of the email to delete
* @return
true
if the email has been properly deleted
* @return
boolean
if the email has been properly deleted
* or false if an error occured ($err is filled accordingly)
*/
function
hook_dom_del_mx_domain
(
$dom_id
)
{
...
...
@@ -456,7 +460,7 @@ ORDER BY
* should be used by the web interface, not by third-party programs.
*
* @param $mail_id integer the number of the email to delete
* @return
true
if the email has been properly deleted
* @return
boolean
if the email has been properly deleted
* or false if an error occured ($err is filled accordingly)
*/
function
delete
(
$mail_id
){
...
...
@@ -510,7 +514,7 @@ ORDER BY
* should be used by the web interface, not by third-party programs.
*
* @param $mail_id integer the email id
* @return
true
if the email has been properly undeleted
* @return
boolean
if the email has been properly undeleted
* or false if an error occured ($err is filled accordingly)
*/
function
undelete
(
$mail_id
){
...
...
@@ -607,10 +611,10 @@ ORDER BY
* should be used by the web interface, not by third-party programs.
*
* @param $mail_id integer the number of the email to delete
* @param $islocal boolean is it a POP/IMAP mailbox ?
* @param $quotamb integer if islocal=1, quota in MB
* @param
integer
$islocal boolean is it a POP/IMAP mailbox ?
* @param
integer
$quotamb integer if islocal=1, quota in MB
* @param $recipients string recipients, one mail per line.
* @return
true
if the email has been properly edited
* @return
boolean
if the email has been properly edited
* or false if an error occured ($err is filled accordingly)
*/
function
set_details
(
$mail_id
,
$islocal
,
$quotamb
,
$recipients
,
$delivery
=
"dovecot"
,
$dontcheck
=
false
)
{
...
...
@@ -695,6 +699,8 @@ ORDER BY
* @ param : $m , the alias we want to create
* @ param : $alias , the already existing aliased address
* @ param : $type, the type of the alias created
* @param string $m
* @param string $alias
*/
function
create_alias
(
$dom_id
,
$m
,
$alias
,
$type
=
""
,
$dontcheck
=
false
)
{
global
$err
,
$db
,
$mail
;
...
...
bureau/class/m_mysql.php
View file @
7cd158c4
...
...
@@ -191,7 +191,7 @@ class m_mysql {
/*---------------------------------------------------------------------------*/
/** Returns the details of a user's database.
* $dbn is the name of the database (after the _) or nothing for the database "$user"
* @return
array
returns an associative array as follow :
* @return
string
returns an associative array as follow :
* "db" => Name of the database
* "bck" => Current bckup mode
* "dir" => Backup directory
...
...
@@ -234,7 +234,7 @@ class m_mysql {
/*---------------------------------------------------------------------------*/
/** Create a new database for the current user.
* @param $dbn string Database name ($user_$dbn is the mysql db name)
* @return
TRUE
if the database $user_$db has been successfully created, or FALSE if
* @return
boolean
if the database $user_$db has been successfully created, or FALSE if
* an error occured, such as over quota user.
*/
function
add_db
(
$dbn
)
{
...
...
@@ -315,7 +315,7 @@ class m_mysql {
/*---------------------------------------------------------------------------*/
/** Delete a database for the current user.
* @param $dbn string Name of the database to delete. The db name is $user_$dbn
* @return
TRUE
if the database $user_$db has been successfully deleted, or FALSE if
* @return
boolean
if the database $user_$db has been successfully deleted, or FALSE if
* an error occured, such as db does not exist.
*/
function
del_db
(
$dbn
)
{
...
...
@@ -688,9 +688,9 @@ class m_mysql {
/**
* Create a new user in MySQL rights tables
* @param $usern the username (we will add _[alternc-account] to it)
* @param $password The password for this username
* @param $passconf The password confirmation
* @return
TRUE
if the user has been created in MySQL or FALSE if an error occurred
* @param
string
$password The password for this username
* @param
string
$passconf The password confirmation
* @return
boolean
if the user has been created in MySQL or FALSE if an error occurred
**/
function
add_user
(
$usern
,
$password
,
$passconf
)
{
global
$db
,
$err
,
$quota
,
$mem
,
$cuid
,
$admin
;
...
...
@@ -754,7 +754,7 @@ class m_mysql {
* @param $usern the username
* @param $password The password for this username
* @param $passconf The password confirmation
* @return
TRUE
if the password has been changed in MySQL or FALSE if an error occurred
* @return
boolean
if the password has been changed in MySQL or FALSE if an error occurred
**/
function
change_user_password
(
$usern
,
$password
,
$passconf
)
{
global
$db
,
$err
,
$quota
,
$mem
,
$cuid
,
$admin
;
...
...
@@ -785,7 +785,8 @@ class m_mysql {
/**
* Delete a user in MySQL rights tables
* @param $user the username (we will add "[alternc-account]_" to it) to delete
* @return TRUE if the user has been deleted in MySQL or FALSE if an error occurred
* @param integer $all
* @return boolean if the user has been deleted in MySQL or FALSE if an error occurred
**/
function
del_user
(
$user
,
$all
=
null
)
{
global
$db
,
$err
,
$mem
,
$cuid
;
...
...
bureau/class/m_piwik.php
View file @
7cd158c4
...
...
@@ -154,6 +154,9 @@ class m_piwik {
else
return
FALSE
;
}
/**
* @param string $user_login
*/
function
get_user
(
$user_login
)
{
$api_data
=
$this
->
call_privileged_page
(
'API'
,
'UsersManager.getUser'
,
array
(
'userLogin'
=>
$user_login
));
...
...
@@ -380,6 +383,10 @@ class m_piwik {
}
/**
* @param string $module
* @param string $method
*/
function
call_privileged_page
(
$module
,
$method
,
$arguments
=
array
(),
$output
=
'JSON'
)
{
$arguments
[
'token_auth'
]
=
$this
->
piwik_admin_token
;
return
$this
->
call_page
(
$module
,
$method
,
$arguments
,
$output
);
...
...
bureau/class/m_quota.php
View file @
7cd158c4
...
...
@@ -86,6 +86,7 @@ class m_quota {
/** Check if a user can use a ressource.
* @param string $ressource the ressource name (a named quota)
* @Return TRUE if the user can create a ressource (= is there any quota left ?)
* @return boolean
*/
function
cancreate
(
$ressource
=
""
)
{
$t
=
$this
->
getquota
(
$ressource
);
...
...
bureau/class/m_variables.php
View file @
7cd158c4
...
...
@@ -296,7 +296,7 @@ class m_variables {
* @param mixed $v
* @param string $varname
* @param boolean $echo
* @return
type
* @return
string
*/
function
display_valueraw_html
(
$v
,
$varname
,
$echo
=
true
)
{
$output
=
""
;
...
...
bureau/class/vm.class.php
View file @
7cd158c4
<?php
interface
vm
{
public
function
start
();
/**
* @return boolean
*/
public
function
stop
();
}
phpunit/AutoLoader.php
View file @
7cd158c4
...
...
@@ -22,6 +22,10 @@ class AutoLoader {
}
}
/**
* @param string $className
* @param string $fileName
*/
public
static
function
registerClass
(
$className
,
$fileName
)
{
AutoLoader
::
$classNames
[
$className
]
=
$fileName
;
}
...
...
phpunit/lib/AlterncTest.php
View file @
7cd158c4
...
...
@@ -17,7 +17,7 @@ abstract class AlterncTest extends PHPUnit_Extensions_Database_TestCase
/**
*
* @param
type
$file_name
* @param
string
$file_name
* @return \PHPUnit_Extensions_Database_DataSet_YamlDataSet
* @throws \Exception
*/
...
...
roundcube/class/m_roundcube.php
View file @
7cd158c4
...
...
@@ -69,7 +69,7 @@ class m_roundcube {
/** Hook called when an email is REALLY deleted (by the cron, not just in the panel)
* @param mail_id integer the ID of the mail in the AlternC database
* @param fullmail string the deleted mail himself in the form of john@domain.tld
* @return
boolean
* @return
false|null
*/
function
hook_mail_delete_for_real
(
$mail_id
,
$fullmail
)
{
// Include Roundcube configuration
...
...
squirrelmail/class/m_squirrelmail.php
View file @
7cd158c4
...
...
@@ -69,7 +69,7 @@ class m_squirrelmail {
/** Hook called when an email is REALLY deleted (by the cron, not just in the panel)
* @param mail_id integer the ID of the mail in the AlternC database
* @param fullmail string the deleted mail himself in the form of john@domain.tld
* @return boolean
* @return boolean
|null
*/
function
hook_mail_delete_for_real
(
$mail_id
,
$fullmail
)
{
$fullmail2
=
str_replace
(
'@'
,
'_'
,
$fullmail
);
// fullname with _ instead of @ (compatibility)
...
...
src/fix_dovecot_quota.php
View file @
7cd158c4
...
...
@@ -2,6 +2,9 @@
<?php
require_once
(
"/usr/share/alternc/panel/class/config_nochk.php"
);
/**
* @param string $msg
*/
function
usage
(
$msg
=
null
)
{
if
(
$msg
)
{
echo
"Error:
\n
$msg
"
;
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment