Пример #1
0
 *  The above copyright notice and this permission notice shall be included in all 
 *  copies or substantial portions of the Software.
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
 *  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
 *  PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
 *  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
 *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
 *  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
include_once 'include.php';
if (isset($_REQUEST['doit'])) {
    // store here visual alert messages: error() or success()
    $alert = '';
    // Depending on action, we prepare the local path to the user's profile dir
    if ($_REQUEST['action'] == 'edit') {
        $user_dir = webid_get_local_path($_SESSION['webid']);
        $webid_base = $base_uri . '/' . $user_dir . '/card';
        $webid = $_SESSION['webid'];
    } else {
        // prepare the new WebID URI
        $webid_base = $base_uri . '/people/' . $_REQUEST['uri'] . '/card';
        $webid = $webid_base . "#me";
        $user_dir = "people/" . $_REQUEST['uri'];
    }
    // Check if the user uploaded a new picture
    if (isset($_FILES['picture']) && $_FILES['picture']['error'] == 0) {
        // Allow only pictures with a size smaller than 100k
        if ($_FILES['picture']['size'] <= 100000) {
            // Using getimagesize() to avoid fake mime types
            $image_info = exif_imagetype($_FILES['picture']['tmp_name']);
            $local_img = '';
Пример #2
0
 *  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
 *  PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
 *  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
 *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
 *  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
require_once 'include.php';
$title = "Preferences";
$pref_on = 'settings-on';
// verify if we're logged in or not
check_auth(IDP, $page_uri);
$ret = '';
$ret .= "<div class=\"content relative shadow clearfix main\">\n";
if (webid_is_local($_SESSION['webid'])) {
    if ($_REQUEST['action'] == 'deleteacc') {
        $path = webid_get_local_path($_SESSION['webid']);
        $ok_del = false;
        // delete profile
        if ($_SESSION['myprofile']->delete_account() && rrmdir($path)) {
            $ok_del = true;
        }
        // display confirmation
        if ($ok_del) {
            $ret .= success('Your profile has been deleted.');
            $ret .= "<div><br/>Attention: do not forget to delete the corresponding certificate from your browser, since it is useless now.</div>\n";
        } else {
            $ret .= error('Could not remove your profile!');
        }
        // log user out and clear WebID session
        if ($_SESSION['webid']) {
            $auth->logout;