diff --git a/inc/DAVResource.php b/inc/DAVResource.php index 27b8cd3e..df95005a 100644 --- a/inc/DAVResource.php +++ b/inc/DAVResource.php @@ -755,6 +755,7 @@ EOQRY; /** * Fetch the parent to this resource. This is deprecated - use GetParentContainer() instead. + * @deprecated */ function FetchParentContainer() { deprecated('DAVResource::FetchParentContainer'); diff --git a/inc/auth-functions.php b/inc/auth-functions.php index 9b171670..1adfd870 100644 --- a/inc/auth-functions.php +++ b/inc/auth-functions.php @@ -28,36 +28,46 @@ require_once("DataUpdate.php"); if ( !function_exists('auth_functions_deprecated') ) { + /** + * Warn about deprecated auth functions + */ function auth_functions_deprecated( $method, $message = null ) { - global $c; - if ( isset($c->dbg['ALL']) || isset($c->dbg['deprecated']) ) { $stack = debug_backtrace(); array_shift($stack); - if ( preg_match( '{/inc/auth-functions.php$}', $stack[0]['file'] ) && $stack[0]['line'] > __LINE__ ) return; - dbg_error_log("LOG", " auth-functions: Call to deprecated routine '%s'%s", $method, (isset($message)?': '.$message:'') ); + dbg_error_log("ERROR", " auth-functions: Call to deprecated routine '%s'%s", $method, (isset($message)?': '.$message:'') ); foreach( $stack AS $k => $v ) { - dbg_error_log( 'LOG', ' auth-functions: Deprecated call from line %4d of %s', $v['line'], $v['file']); + dbg_error_log( 'ERROR', ' auth-functions: Deprecated call from line %4d of %s', $v['line'], $v['file']); } - } } } - +/** + * @deprecated + */ function getUserByName( $username, $use_cache=true ) { auth_functions_deprecated('getUserByName','replaced by Principal class'); return new Principal('username', $username, $use_cache); } +/** + * @deprecated + */ function getUserByEMail( $email, $use_cache = true ) { auth_functions_deprecated('getUserByEMail','replaced by Principal class'); return new Principal('email', $email, $use_cache); } +/** + * @deprecated + */ function getUserByID( $user_no, $use_cache = true ) { auth_functions_deprecated('getUserByID','replaced by Principal class'); return new Principal('user_no', $user_no, $use_cache); } +/** + * @deprecated + */ function getPrincipalByID( $principal_id, $use_cache = true ) { auth_functions_deprecated('getPrincipalByID','replaced by Principal class'); return new Principal('principal_id', $principal_id, $use_cache); @@ -168,8 +178,8 @@ function CreateHomeCollections( $username, $defult_timezone = null ) { } /** - * Backward compatibility - * @param unknown_type $username + * @deprecated + * @param string $username */ function CreateHomeCalendar($username) { auth_functions_deprecated('CreateHomeCalendar','renamed to CreateHomeCollections'); @@ -185,11 +195,12 @@ function CreateDefaultRelationships( $username ) { if(! isset($c->default_relationships) || count($c->default_relationships) == 0) return true; $changes = false; + $principal = new Principal('username', $username, true); foreach($c->default_relationships as $group => $relationships) { $sql = 'INSERT INTO grants (by_principal, to_principal, privileges) VALUES(:by_principal, :to_principal, :privileges::INT::BIT(24))'; $params = array( - ':by_principal' => getUserByName($username)->principal_id, + ':by_principal' => $principal->principal_id, ':to_principal' => $group, ':privileges' => privilege_to_bits($relationships) ); @@ -211,7 +222,11 @@ function CreateDefaultRelationships( $username ) { return true; } - +/** + * Set a new timezone for a user's calendars + * @param string $username + * @param string $new_timezone + */ function UpdateCollectionTimezones( $username, $new_timezone=null ) { if ( empty($new_timezone) ) return; $qry = new AwlQuery('UPDATE collection SET timezone=? WHERE dav_name LIKE ? AND is_calendar', '/'.$username.'/%', $new_timezone); @@ -219,7 +234,7 @@ function UpdateCollectionTimezones( $username, $new_timezone=null ) { } /** -* Update the local cache of the remote user details +* @deprecated * @param object $usr The user details we read from the remote. */ function UpdateUserFromExternal( &$usr ) { diff --git a/inc/caldav-client.php b/inc/caldav-client.php index acd59350..71585f8c 100644 --- a/inc/caldav-client.php +++ b/inc/caldav-client.php @@ -303,7 +303,6 @@ class CalDAVClient { * * @param string $filter XML fragment which is the element of a calendar-query * @param string $relative_url The URL relative to the base_url specified when the calendar was opened. Default ''. - * @param string $report_type Used as a name for the array element containing the calendar data. @deprecated * * @return array An array of the relative URLs, etags, and events from the server. Each element of the array will * be an array with 'href', 'etag' and 'data' elements, corresponding to the URL, the server-supplied diff --git a/inc/drivers_imap_pam.php b/inc/drivers_imap_pam.php index 9d00aa1f..0bddec5e 100644 --- a/inc/drivers_imap_pam.php +++ b/inc/drivers_imap_pam.php @@ -104,7 +104,7 @@ function IMAP_PAM_check($username, $password ){ dbg_error_log( "PAM", "Unable to create local principal for '%s'", $username ); return false; } - CreateHomeCalendar($username); + CreateHomeCollections($username); } return $principal; } diff --git a/inc/drivers_pwauth_pam.php b/inc/drivers_pwauth_pam.php index 791bbc7d..3f94d68a 100644 --- a/inc/drivers_pwauth_pam.php +++ b/inc/drivers_pwauth_pam.php @@ -76,7 +76,7 @@ function PWAUTH_PAM_check($username, $password) { dbg_error_log( "PAM", "Unable to create local principal for '%s'", $username ); return false; } - CreateHomeCalendar($username); + CreateHomeCollections($username); } return $principal; break; diff --git a/inc/drivers_squid_pam.php b/inc/drivers_squid_pam.php index 2cfab0e5..e1f033e6 100644 --- a/inc/drivers_squid_pam.php +++ b/inc/drivers_squid_pam.php @@ -67,7 +67,7 @@ function SQUID_PAM_check($username, $password ){ dbg_error_log( "PAM", "Unable to create local principal for '%s'", $username ); return false; } - CreateHomeCalendar($username); + CreateHomeCollections($username); } return $principal; }