]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
The usual asset of bugfixes/improvements:
[mailer.git] / inc / wrapper-functions.php
index 4c3e4a8c0e835c630b338c1dc3677e731c6ae04a..80a4236061b0257e1eb83ee3eda39b7fa487eb0d 100644 (file)
@@ -771,7 +771,7 @@ function isDemoModeActive () {
        // Is cache set?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Simply check it
-               $GLOBALS[__FUNCTION__] = ((isExtensionActive('demo')) && (getAdminLogin(getSession('admin_id')) == 'demo'));
+               $GLOBALS[__FUNCTION__] = ((isExtensionActive('demo')) && (getCurrentAdminLogin() == 'demo'));
        } // END - if
 
        // Return it
@@ -800,6 +800,69 @@ function setAdminHash ($adminId, $hash) {
        $GLOBALS['cache_array']['admin']['password'][$adminId] = $hash;
 }
 
+// Getter for current admin login
+function getCurrentAdminLogin () {
+       // Log debug message
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'called!');
+
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getAdminLogin(getCurrentAdminId());
+       } // END - if
+
+       // Return it
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Setter for admin id (and current)
+function setAdminId ($adminId) {
+       // Log debug message
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'adminId=' . $adminId);
+
+       // Set session
+       $status = setSession('admin_id', bigintval($adminId));
+
+       // Set current id
+       setCurrentAdminId($adminId);
+
+       // Return status
+       return $status;
+}
+
+// Setter for admin_last
+function setAdminLast ($adminLast) {
+       // Log debug message
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'adminLast=' . $adminLast);
+
+       // Set session
+       $status = setSession('admin_last', $adminLast);
+
+       // Return status
+       return $status;
+}
+
+// Setter for admin_md5
+function setAdminMd5 ($adminMd5) {
+       // Log debug message
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'adminMd5=' . $adminMd5);
+
+       // Set session
+       $status = setSession('admin_md5', $adminMd5);
+
+       // Return status
+       return $status;
+}
+
+// Getter for admin_md5
+function getAdminMd5 () {
+       // Log debug message
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'called!');
+
+       // Get session
+       return getSession('admin_md5');
+}
+
 // Init user data array
 function initUserData () {
        // User id should not be zero
@@ -1946,6 +2009,30 @@ function getLastMonth () {
        return $GLOBALS[__FUNCTION__];
 }
 
+// "Getter" for max_send
+function getMaxSend () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('max_send');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for __DB_NAME
+function getDbName () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('__DB_NAME');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // Checks wether proxy configuration is used
 function isProxyUsed () {
        // Do we have cache?
@@ -2074,5 +2161,14 @@ function appendLineToFile ($file, $line) {
        fclose($fp);
 }
 
+// Wrapper for changeDataInFile() but with full path added
+function changeDataInInclude ($FQFN, $comment, $prefix, $suffix, $DATA, $seek=0) {
+       // Add full path
+       $FQFN = getPath() . $FQFN;
+
+       // Call inner function
+       changeDataInFile($FQFN, $comment, $prefix, $suffix, $DATA, $seek);
+}
+
 // [EOF]
 ?>