post sp24 login changes
This commit is contained in:
parent
87410d5f09
commit
cfd9b24303
3
api2.php
3
api2.php
|
|
@ -229,6 +229,8 @@ function appdata() {
|
||||||
// hosts
|
// hosts
|
||||||
$hh = multi_row_1d("select session FROM conf_hosts WHERE host='{$USER['conf_id']}';");
|
$hh = multi_row_1d("select session FROM conf_hosts WHERE host='{$USER['conf_id']}';");
|
||||||
|
|
||||||
|
$hbs = multi_row_select("select s.id, s.title, s.starttime, u.name, u.email, u.id AS hostid from conf_sessions as s LEFT OUTER JOIN conf_hosts as h ON h.session=s.id LEFT OUTER JOIN conf_users AS u ON h.host=u.id WHERE s.id>1319 ORDER BY u.name;",0);
|
||||||
|
|
||||||
// conferences
|
// conferences
|
||||||
$c = multi_row_select('SELECT * FROM conf_conferences;',0);
|
$c = multi_row_select('SELECT * FROM conf_conferences;',0);
|
||||||
|
|
||||||
|
|
@ -241,6 +243,7 @@ function appdata() {
|
||||||
"mysessions" => $m,
|
"mysessions" => $m,
|
||||||
"sessions" => $s,
|
"sessions" => $s,
|
||||||
"host" => $hh,
|
"host" => $hh,
|
||||||
|
"hostbysession" => $hbs,
|
||||||
"user" => $USER,
|
"user" => $USER,
|
||||||
"conference" => $c,
|
"conference" => $c,
|
||||||
"ay" => $y,
|
"ay" => $y,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$TEST = 1;
|
||||||
|
|
||||||
|
// Create a new mysqli instance
|
||||||
|
if ($TEST) {
|
||||||
|
$mysqli = new mysqli("192.168.1.6", "phowell", "rolley34", "db");
|
||||||
|
} else {
|
||||||
|
$mysqli = new mysqli("localhost", "phowell", "p^howell", "PeterDB");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for connection error
|
||||||
|
if ($mysqli->connect_error) {
|
||||||
|
die("Connection failed: " . $mysqli->connect_error);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start a query to get rows ordered by 'goo'
|
||||||
|
$query = "SELECT * FROM conf_users ORDER BY goo DESC LIMIT 5000";
|
||||||
|
$result = $mysqli->query($query);
|
||||||
|
|
||||||
|
// Key: goo, Value: id
|
||||||
|
$goo_to_id = array();
|
||||||
|
|
||||||
|
// Iterating through each result
|
||||||
|
while ($row = $result->fetch_assoc()) {
|
||||||
|
$id = $row['id'];
|
||||||
|
$goo = $row['goo'];
|
||||||
|
|
||||||
|
// Check if an entry exists for this 'goo'
|
||||||
|
if (array_key_exists($goo, $goo_to_id)) {
|
||||||
|
// Save lower and higher id
|
||||||
|
$lower_id = min($id, $goo_to_id[$goo]);
|
||||||
|
$higher_id = max($id, $goo_to_id[$goo]);
|
||||||
|
|
||||||
|
echo "(test) UPDATE conf_signups SET user={$lower_id} WHERE user={$higher_id}\n<br>\n";
|
||||||
|
|
||||||
|
// Prepare an update statement and execute
|
||||||
|
|
||||||
|
if (! $TEST) {
|
||||||
|
$update_stmt = $mysqli->prepare("UPDATE conf_signups SET user=? WHERE user=?");
|
||||||
|
$update_stmt->bind_param("ii", $lower_id, $higher_id);
|
||||||
|
$update_stmt->execute();
|
||||||
|
echo "UPDATE conf_signups SET user={$lower_id} WHERE user={$higher_id}\n<br>\n";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$goo_to_id[$goo] = $id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Closing the database connection
|
||||||
|
$mysqli->close();
|
||||||
|
|
@ -925,7 +925,7 @@ const ActivityList = Vue.component('activitylist', {
|
||||||
methods: {
|
methods: {
|
||||||
hoststr: function(id) { var self = this
|
hoststr: function(id) { var self = this
|
||||||
return _.reduce( self.hosts_by_sesid[id], function(mem,val) { if (val.name) { return mem + val.name + ", " } return mem }, '') },
|
return _.reduce( self.hosts_by_sesid[id], function(mem,val) { if (val.name) { return mem + val.name + ", " } return mem }, '') },
|
||||||
mode_string: function(a) { if (this.active>3) { return _.findWhere(this.$root.modes_menu, { 'id': a.mode })['string'] } return a.mode },
|
mode_string: function(a) { if (this.$root.active) { return _.findWhere(this.$root.modes_menu, { 'id': a.mode })['string'] } return a.mode },
|
||||||
get_day_title: function(day) {
|
get_day_title: function(day) {
|
||||||
console.log(day)
|
console.log(day)
|
||||||
var d = dayjs(day, 'MMM DD YYYY')
|
var d = dayjs(day, 'MMM DD YYYY')
|
||||||
|
|
@ -942,6 +942,10 @@ const ActivityList = Vue.component('activitylist', {
|
||||||
am_editing: function(id) { return 0 },
|
am_editing: function(id) { return 0 },
|
||||||
fetch_myevents: function() {
|
fetch_myevents: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
basic_get('dir_api.php?a=get/hosts', function(r2) {
|
||||||
|
self.hosts_by_sesid = _.groupBy(r2,function(x) { return x.id } )
|
||||||
|
} )
|
||||||
|
|
||||||
basic_get('api2.php?query=app',
|
basic_get('api2.php?query=app',
|
||||||
function(r2) {
|
function(r2) {
|
||||||
self.mysessions = r2.mysessions
|
self.mysessions = r2.mysessions
|
||||||
|
|
@ -952,6 +956,7 @@ const ActivityList = Vue.component('activitylist', {
|
||||||
self.options = r2.options
|
self.options = r2.options
|
||||||
self.conference = r2.conference
|
self.conference = r2.conference
|
||||||
self.ay = r2.ay
|
self.ay = r2.ay
|
||||||
|
self.hosts_by_sesid = _.groupBy(r2.hostbysession,function(x) { return x.id } )
|
||||||
|
|
||||||
self.survey_on = parseInt( _.findWhere(self.options, { label:'survey_on' }).value )
|
self.survey_on = parseInt( _.findWhere(self.options, { label:'survey_on' }).value )
|
||||||
self.zoom_on = parseInt( _.findWhere(self.options, { label:'zoom_on' }).value )
|
self.zoom_on = parseInt( _.findWhere(self.options, { label:'zoom_on' }).value )
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
<meta name="viewport" content="initial-scale=1.0" />
|
<meta name="viewport" content="initial-scale=1.0" />
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<?php
|
<?php
|
||||||
|
date_default_timezone_set('America/Los_Angeles');
|
||||||
$server = $_SERVER['SERVER_NAME'];
|
$server = $_SERVER['SERVER_NAME'];
|
||||||
if ( $server == 'intranet1.gavilan.edu') {
|
if ( $server == 'intranet1.gavilan.edu') {
|
||||||
require 'mAuth.php';
|
require 'mAuth.php';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue