*/
/** Access denied. This can be due to missing access rights. */
define("ER_ERROR_ACCESS_DENIED", _c("error-reporter:Access denied"));
-/** Error while querying the database, maybe due to a lost connection to the server */
-define("ER_ERROR_SQL", _c("error-reporter:Error while trying to query the database"));
+/**
+ * Error while querying the database, maybe due to a lost connection to the
+ * server
+ */
+define("ER_ERROR_SQL", _c("error-reporter:Error while trying to query the ".
+ "database"));
/** Error while trying to open a file */
define("ER_ERROR_OPEN_FILE", _c("error-reporter:Could not open file"));
/** Error while trying to write a file */
function setLastError($cError) { $GLOBALS["ercLastError"] = $cError; }
/**
* Get the error that occured last.
- * @return (constant) Error code, see @ref error-reporter_errorcodes for a list of constants.
+ * @return (constant) Error code, see @ref error-reporter_errorcodes for a list
+ * of constants.
*/
function getLastError() { return $GLOBALS["ercLastError"]; }
* @return void
*/
function printLastError() {
- echo sprintf("<p class='err'>%s %s</p>", _c("error-reporter:An error occured:"), getLastError());
+ echo sprintf("<p class='err'>%s %s</p>", _c("error-reporter:An error ".
+ "occured:"), getLastError());
}
/**
/**
* Get the real user name for an account name
* @param $strAct (string) Account name of the user to look up
- * @return (string) The real name of the user. If the function fails, it returns <tt>null</tt>.
+ * @return (string) The real name of the user. If the function fails, it
+ * returns <tt>null</tt>.
* @throws Exception
*/
function erGetRealUserName($strAct) {
- $hQuery = db_query("SELECT firstname, lastname FROM users WHERE act = $1;", $strAct);
+ $hQuery = db_query("SELECT firstname, lastname FROM users WHERE act = $1;",
+ $strAct);
if(!is_resource($hQuery)) {
- throw new Exception(ER_ERROR_SQL);
- return null;
+ throw new Exception(ER_ERROR_SQL);
+ return null;
}
if(pg_num_rows($hQuery) == 0) {
return $strAct; // User not found in database, return account name
* @throws Exception
*/
function erIsGroup($strAct) {
- $hQuery = db_query(sprintf("SELECT * FROM groups WHERE act=%s;", qdb($strAct)));
+ $hQuery = db_query(sprintf("SELECT * FROM groups WHERE act=%s;",
+ qdb($strAct)));
if(!is_resource($hQuery)) {
throw new Exception(ER_ERROR_SQL);
return null;
/**
* Look up the name of a group
* @param $strAct (string) Account name of the group
- * @return (string) The name of the group. If the function fails, it returns <tt>null</tt>.
+ * @return (string) The name of the group. If the function fails, it returns
+ * <tt>null</tt>.
* @throws Exception
*/
function erGetGroupName($strAct) {
- $hQuery = db_query(sprintf("SELECT * FROM groups WHERE act=%s;", qdb($strAct)));
+ $hQuery = db_query(sprintf("SELECT * FROM groups WHERE act=%s;",
+ qdb($strAct)));
if(!is_resource($hQuery)) {
- throw new Exception(ER_ERROR_SQL);
- return null;
+ throw new Exception(ER_ERROR_SQL);
+ return null;
}
if(pg_num_rows($hQuery) == 0) {
return $strAct; // Group not found in database, return account name
/**
* Create a link to write a mail to the specified account name.
- * This function returns a link if the specified account exists, otherwise it returns the
- * account name.
+ * This function returns a link if the specified account exists, otherwise it
+ * returns the account name.
* @param $strAct (string) Account name
* @return string
*/
* @return string
*/
function erIsMailAddress($strAddr) {
- return ((preg_match("/([a-zA-Z0-9_\-\.]*(@[a-zA-Z0-9\-\.]*)?(\s*,\s*)?)+/", $strAddr) > 0)
- and (preg_match("/(\s*,\s*)$/", $strAddr) == 0));
+ return ((preg_match("/([a-zA-Z0-9_\-\.]*(@[a-zA-Z0-9\-\.]*)?(\s*,\s*)?)+/",
+ $strAddr) > 0) and (preg_match("/(\s*,\s*)$/", $strAddr) == 0));
}
function erInsertLog($sMsg) {
log_insert($sMsg, null, "Error Report Wizard");
}
-?>
\ No newline at end of file
+?>