/extremedating/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/extremedating/trunk

« back to all changes in this revision

Viewing changes to adduser.php

  • Committer: Gustav Hatvigsson
  • Date: 2013-04-14 06:22:44 UTC
  • mto: This revision was merged to the branch mainline in revision 59.
  • Revision ID: gustav.hartvigsson@gmail.com-20130414062244-095y9gkxug005eqd
added a litle stuffs

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
26
26
<head>
27
27
<?php
28
 
set_time_limit(0);
29
28
include "php/db.php";
30
29
include "php/salt.php";
31
 
include "php/stupid_image.php";
32
 
set_time_limit(60);
33
 
ini_set("post_max_size","16M");
34
 
ini_set("upload_max_filesize","16M");
35
 
ini_set("memory_limit","64M");
36
 
 
37
30
if(isset($_POST['hiddenStuff']) && $_POST['hiddenStuff'] == "Something Strange") {
38
31
  $password = sha1($_POST['passwd'].$pwd_salt);
39
32
  //If there is a $_POST that indicates that the add userscript should be run.
44
37
    $handle = fopen($tmpFile,"r");
45
38
    $fileSize = $_FILES['image']['size'];
46
39
    $output = fread($handle, filesize($tmpFile));
47
 
    $image = new Imagick();
48
 
    $image->readImageBlob($output);
49
 
    $image = stupid_convert_and_rescale($image, 280, 280, 'png');
50
 
    $output = base64_encode ($image);
 
40
    $output = base64_encode ($output);
51
41
  }
52
42
  if (isset($_SESSION['userType']) && $_POST['isSuperUser'] == true && $_SESSION['userType'] == 1) {
53
43
    $query = "INSERT INTO Users (
92
82
    '{$output}'
93
83
    );";
94
84
  }
95
 
  $success = NULL;
96
85
  try {
97
 
    $db->exec($query);
98
 
    $success = true;
 
86
  $db->exec($query);
99
87
  } catch (PDOException $err) {
100
 
    echo "<pre>";
101
88
    var_dump($err);
102
 
    var_dump($query);
103
 
    echo "</pre>";
104
 
    $db->rollBack();
105
 
    $success = false;
106
 
  } if ($success) {
107
 
    echo "<body> <h1> New user added! </h1> </body>";
108
 
    sleep(1);
109
 
    header("Location:./index.php");
110
89
  }
 
90
  echo "<body> <h1> New user added! </h1> </body>";
 
91
  sleep(.5);
 
92
  header("Location:./index.php");
111
93
} else {
112
94
 
113
95
?>
155
137
              <td> <input type="input" name="city" id="city" /> </td>
156
138
            </tr>
157
139
            <tr>
158
 
              <td> <label for="file"> Profile Image </label> </td>
 
140
              <td> <label for="file"> City </label> </td>
159
141
              <td> <input type="file" name="image" id="image" /> </td>
160
142
            </tr>
161
143
                              <tr>