Пример #1
0
 public function getCurrentProfileId()
 {
     if (!class_exists('SessionUtils')) {
         include APP_BASE_PATH . "include.common.php";
     }
     $adminEmpId = SessionUtils::getSessionObject('admin_current_profile');
     $user = SessionUtils::getSessionObject('user');
     if (empty($adminEmpId) && !empty($user)) {
         $signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
         return $user->{$signInMappingField};
     }
     return $adminEmpId;
 }
Пример #2
0
<?php

include "config.base.php";
include "include.common.php";
if (defined('MODULE_PATH')) {
    SessionUtils::saveSessionObject("modulePath", MODULE_PATH);
}
define('CLIENT_PATH', dirname(__FILE__));
include CLIENT_PATH . "/include.common.php";
include CLIENT_PATH . "/server.includes.inc.php";
$user = SessionUtils::getSessionObject('user');
$profileCurrent = null;
$profileSwitched = null;
$profileClass = ucfirst(SIGN_IN_ELEMENT_MAPPING_FIELD_NAME);
$profileVar = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
if (!empty($user->{$profileVar})) {
    $profileCurrent = BaseService::getInstance()->getElement($profileClass, $user->{$profileVar}, null, true);
    if (!empty($profileCurrent)) {
        $profileCurrent = FileService::getInstance()->updateProfileImage($profileCurrent);
    }
}
if ($user->user_level == 'Admin' || $user->user_level == 'Manager') {
    $switchedEmpId = BaseService::getInstance()->getCurrentProfileId();
    if ($switchedEmpId != $user->{$profileVar} && !empty($switchedEmpId)) {
        $profileSwitched = BaseService::getInstance()->getElement($profileClass, $switchedEmpId, null, true);
        if (!empty($profileSwitched)) {
            $profileSwitched = FileService::getInstance()->updateProfileImage($profileSwitched);
        }
    }
}
$activeProfile = null;
Пример #3
0
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.

You should have received a copy of the GNU General Public License
along with Ice Framework. If not, see <http://www.gnu.org/licenses/>.

------------------------------------------------------------------

Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]  
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
*/
define('CLIENT_PATH', dirname(__FILE__));
include "config.base.php";
include "include.common.php";
$modulePath = SessionUtils::getSessionObject("modulePath");
if (!defined('MODULE_PATH')) {
    define('MODULE_PATH', $modulePath);
}
include "server.includes.inc.php";
if ($_REQUEST['a'] != "rsp" && $_REQUEST['a'] != "rpc") {
    if (empty($user)) {
        if ($_REQUEST['a'] == 'na') {
            $ret['message'] = "";
            if (empty($_REQUEST['employee'])) {
                $ret['status'] = "ERROR";
                $ret['message'] .= "Select an Employee.<br/>";
            }
            if (empty($_REQUEST['username'])) {
                $ret['status'] = "ERROR";
                $ret['message'] .= "Enter Username.<br/>";