-
Notifications
You must be signed in to change notification settings - Fork 15
/
test.php
41 lines (37 loc) · 1.44 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
ini_set('display_errors', '1');
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
require('model/model.php');
require('dbConnection.php');
require('defines.php');
// echo json_encode(Events::isValidOrg(1020,0,$conn));
// $plaintext = "message to be encrypted";
// $cipher = "aes-128-gcm";
// if (in_array($cipher, openssl_get_cipher_methods()))
// {
// $key = openssl_random_pseudo_bytes(128);
// $ivlen = openssl_cipher_iv_length($cipher);
// $iv = openssl_random_pseudo_bytes($ivlen);
// $ciphertext = openssl_encrypt($plaintext, $cipher, $key);
// echo $ciphertext;
// //store $cipher, $iv, and $tag for decryption later
// }else{
// echo "0";
// }
// $original_plaintext = openssl_decrypt($ciphertext, $cipher, $key);
// echo $original_plaintext."\n";
// echo json_encode($data);
// $pId=1000;
// $eveID = 1;
// $ownerQ = "owner1 = $pId || owner2 = $pId || owner3 = $pId || owner4 = $pId";
// $sql = "SELECT code FROM Events E1
// WHERE
// eveId = $eveID AND (
// ". $ownerQ ." || (
// SELECT count(*) from Events where eveId = E1.code AND (".$ownerQ.")
// )
// )";
// $conn = mysqli_connect(SERVER_ADDRESS,USER_NAME,PASSWORD,DATABASE);
// session_start();
// // People::sendVerificationMailToAll($conn);
// echo json_encode(People::eventNotifyRegUsers(75,"Test","More content",$_SESSION['userID'],$conn));