Пример #1
0
    // get value of field in html format
    $value = $inventory->getValue($fieldNameIntern, 'html');
    // Icons anzeigen
    if (strlen($gInventoryFields->getProperty($fieldNameIntern, 'inf_icon')) > 0) {
        $value = $gInventoryFields->getProperty($fieldNameIntern, 'inf_icon') . '  ' . $value;
    }
    // show html of field, if user has a value for that field or it's a checkbox field
    if (strlen($inventory->getValue($fieldNameIntern)) > 0 || $gInventoryFields->getProperty($fieldNameIntern, 'inf_type') === 'CHECKBOX') {
        $html['label'] = $gInventoryFields->getProperty($fieldNameIntern, 'inf_name');
        $html['value'] = $value;
    }
    return $html;
}
unset($_SESSION['profile_request']);
// set headline
$headline = $gL10n->get('PRO_PROFILE_FROM', $inventory->getValue('ITEM_NAME'));
// if user id was not set and own profile should be shown then initialize navigation
if (!isset($_GET['item_id'])) {
    $gNavigation->clear();
}
$gNavigation->addUrl(CURRENT_URL, $headline);
// create html page object
$page = new HtmlPage($headline);
$page->addCssFile($g_root_path . '/adm_program/libs/bootstrap-datepicker/css/datepicker3.css');
$page->addJavascriptFile($g_root_path . '/adm_program/modules/profile/profile.js');
$page->addJavascriptFile($g_root_path . '/adm_program/libs/bootstrap-datepicker/js/bootstrap-datepicker.js');
$page->addJavascriptFile($g_root_path . '/adm_program/libs/bootstrap-datepicker/js/locales/bootstrap-datepicker.' . $gPreferences['system_language'] . '.js');
$page->addJavascript('
    var profileJS = new profileJSClass();
    profileJS.deleteRole_ConfirmText    = "' . $gL10n->get('ROL_MEMBERSHIP_DEL', '[rol_name]') . '";
    profileJS.deleteFRole_ConfirmText   = "' . $gL10n->get('ROL_LINK_MEMBERSHIP_DEL', '[rol_name]') . '";
Пример #2
0
// checks if the server settings for file_upload are set to ON
if (ini_get('file_uploads') != '1') {
    $gMessage->show($gL10n->get('SYS_SERVER_NO_UPLOAD'));
}
// read user data and show error if user doesn't exists
$gInventoryFields = new InventoryFields($gDb, $gCurrentOrganization->getValue('org_id'));
$inventory = new Inventory($gDb, $gInventoryFields, $getItemId);
// bei Ordnerspeicherung pruefen ob der Unterordner in adm_my_files mit entsprechenden Rechten existiert
if ($gPreferences['profile_photo_storage'] == 1) {
    // ggf. Ordner für Userfotos in adm_my_files anlegen
    $myFilesProfilePhotos = new MyFiles('USER_PROFILE_PHOTOS');
    if ($myFilesProfilePhotos->checkSettings() == false) {
        $gMessage->show($gL10n->get($myFilesProfilePhotos->errorText, $myFilesProfilePhotos->errorPath, '<a href="mailto:' . $gPreferences['email_administrator'] . '">', '</a>'));
    }
}
if ($inventory->getValue('inv_id') == 0) {
    $gMessage->show($gL10n->get('SYS_INVALID_PAGE_VIEW'));
}
if ($getMode == 'save') {
    /*****************************Foto speichern*************************************/
    if ($gPreferences['profile_photo_storage'] == 1) {
        // Foto im Dateisystem speichern
        //Nachsehen ob fuer den User ein Photo gespeichert war
        if (file_exists(SERVER_PATH . '/adm_my_files/item_photos/' . $getItemId . '_new.jpg')) {
            if (file_exists(SERVER_PATH . '/adm_my_files/item_photos/' . $getItemId . '.jpg')) {
                unlink(SERVER_PATH . '/adm_my_files/item_photos/' . $getItemId . '.jpg');
            }
            rename(SERVER_PATH . '/adm_my_files/item_photos/' . $getItemId . '_new.jpg', SERVER_PATH . '/adm_my_files/item_photos/' . $getItemId . '.jpg');
        }
    } else {
        // Foto in der Datenbank speichern
Пример #3
0
require '../../system/common.php';
require '../../system/login_valid.php';
// Initialize and check the parameters
$getItemId = admFuncVariableIsValid($_GET, 'inv_id', 'numeric', array('requireValue' => true));
$getNewPhoto = admFuncVariableIsValid($_GET, 'new_photo', 'boolean');
// lokale Variablen der Uebergabevariablen initialisieren
$image = null;
$picpath = THEME_SERVER_PATH . '/images/no_profile_pic.png';
// only users with the right to edit inventory could use this script
if ($gCurrentUser->editInventory() == false) {
    $gMessage->show($gL10n->get('SYS_NO_RIGHTS'));
}
// read inventory data and show error if inventory doesn't exists
$gInventoryFields = new InventoryFields($gDb, $gCurrentOrganization->getValue('org_id'));
$inventory = new Inventory($gDb, $gInventoryFields, $getItemId);
if ($inventory->getValue('inv_id') == 0) {
    $gMessage->show($gL10n->get('SYS_INVALID_PAGE_VIEW'));
}
//Foto aus adm_my_files
if ($gPreferences['profile_photo_storage'] == 1 && $getNewPhoto == 0) {
    if (file_exists(SERVER_PATH . '/adm_my_files/item_photos/' . $getItemId . '.jpg')) {
        $picpath = SERVER_PATH . '/adm_my_files/item_photos/' . $getItemId . '.jpg';
    }
    $image = new Image($picpath);
} elseif ($gPreferences['profile_photo_storage'] == 0 && $getNewPhoto == 0) {
    if (strlen($inventory->getValue('inv_photo')) != NULL) {
        $image = new Image();
        $image->setImageFromData($inventory->getValue('inv_photo'));
    } else {
        $image = new Image($picpath);
    }