Aleksander Machniak
2016-05-22 77b5d7ee304a688a2eb115ce04b460b43c0dd700
program/steps/settings/save_identity.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/settings/save_identity.inc                              |
 |                                                                       |
@@ -47,6 +47,11 @@
    if (!isset($_POST[$fname])) {
        $save_data[$col] = 0;
    }
}
// make the identity a "default" if only one identity is allowed
if (IDENTITIES_LEVEL > 1) {
    $save_data['standard'] = 1;
}
// unset email address if user has no rights to change it
@@ -130,7 +135,7 @@
    }
    else {
        // show error message
        $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false);
        $OUTPUT->show_message($plugin['message'] ?: 'errorsaving', 'error', null, false);
        $RCMAIL->overwrite_action('edit-identity');
        return;
    }
@@ -154,6 +159,8 @@
        $insert_id = $plugin['result'];
    if ($insert_id) {
        $RCMAIL->plugins->exec_hook('identity_create_after', array('id' => $insert_id, 'record' => $save_data));
        $OUTPUT->show_message('successfullysaved', 'confirmation', null, false);
        $_GET['_iid'] = $insert_id;
@@ -170,7 +177,7 @@
    }
    else {
        // show error message
        $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false);
        $OUTPUT->show_message($plugin['message'] ?: 'errorsaving', 'error', null, false);
        $RCMAIL->overwrite_action('edit-identity');
        return;
    }
@@ -201,7 +208,7 @@
    global $RCMAIL;
    $offset = 0;
    $regexp = '/\s(poster|src)\s*=\s*[\'"]*\S+upload-display\S+file=rcmfile([0-9]+)[\s\'"]*/';
    $regexp = '/\s(poster|src)\s*=\s*[\'"]*\S+upload-display\S+file=rcmfile(\w+)[\s\'"]*/';
    while (preg_match($regexp, $html, $matches, 0, $offset)) {
        $file_id  = $matches[2];
@@ -211,7 +218,7 @@
            $file = $RCMAIL->plugins->exec_hook('attachment_get', $file);
            $data_uri .= 'src="data:' . $file['mimetype'] . ';base64,';
            $data_uri .= base64_encode($file['data'] ? $file['data'] : file_get_contents($file['path']));
            $data_uri .= base64_encode($file['data'] ?: file_get_contents($file['path']));
            $data_uri .= '" ';
        }