Skip to content

Instantly share code, notes, and snippets.

@sundbp
Created January 7, 2013 19:03
Show Gist options
  • Select an option

  • Save sundbp/4477515 to your computer and use it in GitHub Desktop.

Select an option

Save sundbp/4477515 to your computer and use it in GitHub Desktop.
Only in current.lloyd/: check-autorsync.test
diff -r -x .git current.lloyd/public_html/admin/delete.php current.sundbp/public_html/admin/delete.php
6c6
< if (empty($_GET["id"]) || empty($_GET["t"])) {
---
> if(empty($_GET["id"]) || empty($_GET["t"])) {
11c11
< if ($_GET["t"]=="template") {
---
> if($_GET["t"]=="template") {
13c13
< } elseif ($_GET["t"]=="style") {
---
> } else if($_GET["t"]=="style") {
diff -r -x .git current.lloyd/public_html/admin/dnload.php current.sundbp/public_html/admin/dnload.php
3c3
< require_once '../config.inc.php';
---
> require_once "../config.inc.php";
5c5
< if (empty($_GET["id"])) {
---
> if(empty($_GET["id"])) {
9c9
< if (empty($_GET["type"])) {
---
> if(empty($_GET["type"])) {
13,16c13,16
< /* The type of download:
< * "csvb" (blank CSV),
< * "csve" (example CSV),
< * "tpl" (OO template), "pdf" (PDF)
---
> /* The type of download:
> * "csvb" (blank CSV),
> * "csve" (example CSV),
> * "tpl" (OO template), "pdf" (PDF)
25c25
< if ($row = $res->fetch_row()) {
---
> if($row = $res->fetch_row()) {
30c30
< if (empty($uref)) {
---
> if(empty($uref)) {
37c37
< if ($type=="csve") {
---
> if($type=="csve") {
39c39
< } elseif ($type=="csvb") {
---
> } else if ($type=="csvb") {
41c41
< } elseif ($type=="tpl") {
---
> } else if($type=="tpl") {
46c46
< if (empty($path)) {
---
> if(empty($path)) {
diff -r -x .git current.lloyd/public_html/admin/dnload_repo.php current.sundbp/public_html/admin/dnload_repo.php
17c17
< if ($row = $res->fetch_row()) {
---
> if($row = $res->fetch_row()) {
diff -r -x .git current.lloyd/public_html/admin/index.php current.sundbp/public_html/admin/index.php
6d5
<
14c13
< while ($row = $res->fetch_row()) {
---
> while($row = $res->fetch_row()) {
36c35
< while ($row = $res->fetch_row()) {
---
> while($row = $res->fetch_row()) {
49c48
< while ($fn = readdir($dir)) {
---
> while($fn = readdir($dir)) {
63c62
< $sql = "select f.id,f.name,f.added,c.id,c.companyname,f.listing from library_folders f ".
---
> $sql = "select f.id,f.name,f.added,c.id,c.companyname, f.listing from library_folders f ".
65c64
< "order by listing asc";
---
> "order by c.companyname,f.name,f.added";
68c67
< while ($row = $res->fetch_row()) {
---
> while($row = $res->fetch_row()) {
73,74d71
< $f->listing = $row[5];
<
79d75
<
87c83
< while ($row = $res->fetch_row()) {
---
> while($row = $res->fetch_row()) {
diff -r -x .git current.lloyd/public_html/admin/repo.php current.sundbp/public_html/admin/repo.php
3,4c3,4
< require_once '../config.inc.php';
< require_once '../lib/lookups.inc.php';
---
> require_once "../config.inc.php";
> require_once "../lib/lookups.inc.php";
11c11
< if ($_SERVER["REQUEST_METHOD"]=="POST") {
---
> if($_SERVER["REQUEST_METHOD"]=="POST") {
25c25
< if ($docid>0) {
---
> if($docid>0) {
diff -r -x .git current.lloyd/public_html/contribute/repodnload.php current.sundbp/public_html/contribute/repodnload.php
15c15
< if ($row = $res->fetch_row()) {
---
> if($row = $res->fetch_row()) {
20c20
< if (empty($filename)) {
---
> if(empty($filename)) {
diff -r -x .git current.lloyd/public_html/contribute/taskcomments.php current.sundbp/public_html/contribute/taskcomments.php
3,5c3,5
< require_once '../auth.inc.php';
< require_once '../lib/lookups.inc.php';
< require_once '../lib/ooffice/utils.inc.php';
---
> require_once "../auth.inc.php";
> require_once "../lib/lookups.inc.php";
> require_once "../lib/ooffice/utils.inc.php";
10,11c10
< function findStyleFile($sid,$type)
< {
---
> function findStyleFile($sid,$type) {
14,15c13,14
< while ($fn = readdir($dir)) {
< if (strpos($fn,"{$sid}_{$type}.")===0) {
---
> while($fn = readdir($dir)) {
> if(strpos($fn,"{$sid}_{$type}.")===0) {
17d15
<
22d19
<
64a62
>
diff -r -x .git current.lloyd/public_html/contribute/taskdata.php current.sundbp/public_html/contribute/taskdata.php
3,5c3,5
< require_once '../auth.inc.php';
< require_once '../lib/lookups.inc.php';
< require_once '../lib/ooffice/utils.inc.php';
---
> require_once "../auth.inc.php";
> require_once "../lib/lookups.inc.php";
> require_once "../lib/ooffice/utils.inc.php";
14c14
< if ($_FILES["file"]["error"] > 0) {
---
> if($_FILES["file"]["error"] > 0) {
30c30
< if ($task->pagetemplateid==0) { // a PDF
---
> if($task->pagetemplateid==0) { // a PDF
43c43
< if (!feof($fh) || $linecount==0) { // if fgetcsv returned FALSE and not the end of file...
---
> if(!feof($fh) || $linecount==0) { // if fgetcsv returned FALSE and not the end of file...
64c64
< //$exitcode =
---
> //$exitcode =
81a82
>
diff -r -x .git current.lloyd/public_html/lib/AssemblePack.class.php current.sundbp/public_html/lib/AssemblePack.class.php
14c14
< require_once 'ooffice/OpenDocument.class.php';
---
> require_once "ooffice/OpenDocument.class.php";
17,18c17
< function widthForStringUsingFontSize($string, $font, $fontSize)
< {
---
> function widthForStringUsingFontSize($string, $font, $fontSize) {
21c20
< for ($i = 0; $i < strlen($drawingString); $i++) {
---
> for($i = 0; $i < strlen($drawingString); $i++) {
27d25
<
31,32c29,30
< class PackAssembler
< {
---
> class PackAssembler {
>
79,80c77
< public function __construct($packObj, $agendaObj, $stylePath, $datadir, $commentarydir)
< {
---
> public function __construct($packObj, $agendaObj, $stylePath, $datadir, $commentarydir) {
90,91c87
< public function init()
< {
---
> public function init() {
98,99c94
< public function assemble($outputfile)
< {
---
> public function assemble($outputfile) {
115c110
< foreach ($this->pack->sections as $s) {
---
> foreach($this->pack->sections as $s) {
120,121c115,116
< foreach ($s->pages as $p) {
< if ($p->commentaryid>0 && file_exists("{$this->commentarydir}/{$p->commentaryid}.pdf")) {
---
> foreach($s->pages as $p) {
> if($p->commentaryid>0 && file_exists("{$this->commentarydir}/{$p->commentaryid}.pdf")) {
124c119
< if ($p->dataid>0 && file_exists("{$this->datadir}/{$p->dataid}.pdf")) {
---
> if($p->dataid>0 && file_exists("{$this->datadir}/{$p->dataid}.pdf")) {
135,136c130
< private function findStyleFile($type)
< {
---
> private function findStyleFile($type) {
139,140c133,134
< while ($fn = readdir($dir)) {
< if (strpos($fn,"{$sid}_{$type}.")===0) {
---
> while($fn = readdir($dir)) {
> if(strpos($fn,"{$sid}_{$type}.")===0) {
142d135
<
147d139
<
152,154c144,145
< private function initPageRanges()
< {
< /*
---
> private function initPageRanges() {
> /*
163c154
< /* First job is to analyse all PDFs for each page in the pack
---
> /* First job is to analyse all PDFs for each page in the pack
167c158
< foreach ($this->pack->sections as $s) {
---
> foreach($this->pack->sections as $s) {
170c161
< foreach ($s->pages as $p) {
---
> foreach($s->pages as $p) {
172c163
< if (file_exists("{$this->commentarydir}/{$p->commentaryid}.pdf")) {
---
> if(file_exists("{$this->commentarydir}/{$p->commentaryid}.pdf")) {
180c171
< if (file_exists("{$this->datadir}/{$p->dataid}.pdf")) {
---
> if(file_exists("{$this->datadir}/{$p->dataid}.pdf")) {
198,201c189,192
< if (!empty($this->agenda)) {
< foreach ($this->agenda->sections as $s) {
< foreach ($s->pages as $page) { // iterate each page of each section
< if (!empty($page->linkpage)) {
---
> if(!empty($this->agenda)) {
> foreach($this->agenda->sections as $s) {
> foreach($s->pages as $page) { // iterate each page of each section
> if(!empty($page->linkpage)) {
203c194
< if (!empty($packpage) && $packpage->pagecount>0) {
---
> if(!empty($packpage) && $packpage->pagecount>0) {
216,217c207
< private function initStyles()
< {
---
> private function initStyles() {
252,253c242
< private function doSectionContents()
< {
---
> private function doSectionContents() {
268,269c257
< private function doAgenda()
< {
---
> private function doAgenda() {
284,285c272
< private function doImportPages($filepath)
< {
---
> private function doImportPages($filepath) {
288c275
< foreach ($cpdf->pages as $p) {
---
> foreach($cpdf->pages as $p) {
294,295c281
< private function importPage($pdfpage)
< {
---
> private function importPage($pdfpage) {
301c287
< if ($this->importpagenum>1) {
---
> if($this->importpagenum>1) {
311c297
< foreach ($this->pack->sections as $s) {
---
> foreach($this->pack->sections as $s) {
338c324
< if ($this->contentsPageNumber>0 && !empty($this->buttonimg_contents)) {
---
> if($this->contentsPageNumber>0 && !empty($this->buttonimg_contents)) {
350c336
< if ($this->agendaPageNumber>0 && !empty($this->buttonimg_agenda)) {
---
> if($this->agendaPageNumber>0 && !empty($this->buttonimg_agenda)) {
366d351
<
370,372c355,356
< public function getSectionFromId($sectionid)
< {
< foreach ($this->pack->sections as $s) {
---
> public function getSectionFromId($sectionid) {
> foreach($this->pack->sections as $s) {
375d358
<
378,381c361,363
< public function getPageFromId($pageid)
< {
< foreach ($this->pack->sections as $s) {
< foreach ($s->pages as $p) {
---
> public function getPageFromId($pageid) {
> foreach($this->pack->sections as $s) {
> foreach($s->pages as $p) {
385d366
<
391c372
< * and returns the new PDF filename. The resulting PDF should be opened and
---
> * and returns the new PDF filename. The resulting PDF should be opened and
394,396c375,376
< private function buildContentsPDF($sectionid)
< {
< /* Process the template file and give it the appropriate %SECTIONNAME%
---
> private function buildContentsPDF($sectionid) {
> /* Process the template file and give it the appropriate %SECTIONNAME%
398c378
< if ($sectionid==0) {
---
> if($sectionid==0) {
400c380
< } else {
---
> } else {
409c389
< for ($i=0; $i < $nl->length; $i++) { // replace %SECTIONNAME% text (only) with $contentsname
---
> for($i=0; $i < $nl->length; $i++) { // replace %SECTIONNAME% text (only) with $contentsname
444d423
<
448c427
< /**
---
> /**
453,454c432
< private function addContentsToPage($newpage, $sectionid)
< {
---
> private function addContentsToPage($newpage, $sectionid) {
485c463
< if ($sectionid==0) {
---
> if($sectionid==0) {
487c465
< } else {
---
> } else {
494c472
< foreach ($sections as $s) {
---
> foreach($sections as $s) {
497c475
< foreach ($s->pages as $page) {
---
> foreach($s->pages as $page) {
505c483
< if ($page->pagecount>0) {
---
> if($page->pagecount>0) {
513d490
<
517,518c494
< public function isAgendaIncluded()
< {
---
> public function isAgendaIncluded() {
521d496
<
529,530c504
< private function buildAgendaPDF()
< {
---
> private function buildAgendaPDF() {
535c509
< for ($i=0; $i < $nl->length; $i++) { // replace %PACKNAME% text (only) with pack name
---
> for($i=0; $i < $nl->length; $i++) { // replace %PACKNAME% text (only) with pack name
571d544
<
580,581c553
< private function addAgendaToPage($newpage)
< {
---
> private function addAgendaToPage($newpage) {
619c591
< foreach ($this->agenda->sections as $s) {
---
> foreach($this->agenda->sections as $s) {
622c594
< foreach ($s->pages as $page) {
---
> foreach($s->pages as $page) {
627c599
< if (!empty($page->pagecount)) {
---
> if(!empty($page->pagecount)) {
632c604
< if (!empty($page->durationmins) && !empty($this->agenda->starttime)) {
---
> if(!empty($page->durationmins) && !empty($this->agenda->starttime)) {
641c613
< if (!empty($page->linkpage) && !empty($page->pagecount)) {
---
> if(!empty($page->linkpage) && !empty($page->pagecount)) {
650d621
<
657,658c628
< private function buildCoverPDF()
< {
---
> private function buildCoverPDF() {
665c635
< for ($i=0; $i < $nl->length; $i++) {
---
> for($i=0; $i < $nl->length; $i++) {
677c647
< for ($i=0; $i < $nl->length; $i++) {
---
> for($i=0; $i < $nl->length; $i++) {
684c654
< if (!empty($this->agenda->starttime)) {
---
> if(!empty($this->agenda->starttime)) {
689c659
< for ($i=0; $i < $nl->length; $i++) {
---
> for($i=0; $i < $nl->length; $i++) {
704d673
<
709,710c678
< private function doCover()
< {
---
> private function doCover() {
725a694
>
diff -r -x .git current.lloyd/public_html/lib/GhostscriptConvert.php current.sundbp/public_html/lib/GhostscriptConvert.php
6c6
< * Example usage:
---
> * Example usage:
17,51c17,50
< private $_version;
< private $_infile;
< private $_outfile;
<
< public function __construct($version='1.4')
< {
< $this->_version = $version;
< }
<
< public function setInfile($infile)
< {
< $this->_infile = $infile;
< }
<
< public function setOutfile($outfile)
< {
< $this->_outfile = $outfile;
< }
<
< public function batchConvert($folder, $prefix, $postfix)
< {
< }
<
< public function convert()
< {
< $cmd = $this->getCommand;
< exec($cmd, $out);
< }
<
< private function getCommand()
< {
< $cmd = "gs -sDEVICE=pdfwrite -dCompatibilityLevel=%s -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=%s %s",
<
< return sprintf($cmd, ,$version, $outfile, $infile);
< }
---
> private $_version;
> private $_infile;
> private $_outfile;
>
> public function __construct($version='1.4')
> {
> $this->_version = $version;
> }
>
> public function setInfile($infile)
> {
> $this->_infile = $infile;
> }
>
> public function setOutfile($outfile)
> {
> $this->_outfile = $outfile;
> }
>
> public function batchConvert($folder, $prefix, $postfix)
> {
> }
>
> public function convert()
> {
> $cmd = $this->getCommand;
> exec($cmd, $out);
> }
>
> private function getCommand()
> {
> $cmd = "gs -sDEVICE=pdfwrite -dCompatibilityLevel=%s -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=%s %s",
> return sprintf($cmd, ,$version, $outfile, $infile);
> }
52a52
>
diff -r -x .git current.lloyd/public_html/lib/library.inc.php current.sundbp/public_html/lib/library.inc.php
3,4c3,4
< function publish_pack_to_library($packObj, $authorUser)
< {
---
>
> function publish_pack_to_library($packObj, $authorUser) {
37c37
< foreach ($contents->sections as $s) {
---
> foreach($contents->sections as $s) {
45c45
< foreach ($s->pages as $p) {
---
> foreach($s->pages as $p) {
58c58
< foreach ($agenda->sections as $s) {
---
> foreach($agenda->sections as $s) {
65c65
< foreach ($s->pages as $p) {
---
> foreach($s->pages as $p) {
72c72
< if (!empty($pdur) && !empty($starttime)) {
---
> if(!empty($pdur) && !empty($starttime)) {
diff -r -x .git current.lloyd/public_html/lib/PasswordManager.php current.sundbp/public_html/lib/PasswordManager.php
7c7
< parent::__construct($message, $code, $p);
---
> parent::__construct($message, $code, $p);
12c12
< return __CLASS__.": [{$this->code}: {$this->message}\n";
---
> return __CLASS__.": [{$this->code}: {$this->message}\n";
25c25
< $safeEmail = mysql_real_escape_string($emailAddress);
---
> $safeEmail = mysql_real_escape_string($emailAddress);
33,40c33,40
< if (!$this->checkEmailIsValid()) {
< throw new PasswordManagerException("Not valid email");
< }
< $to = $this->_emailAddress;
< $subject = 'How to activate your login';
< $this->setMessage();
< $this->saveToken();
< mail($to, $subject, $this->_message);
---
> if (!$this->checkEmailIsValid()) {
> throw new PasswordManagerException("Not valid email");
> }
> $to = $this->_emailAddress;
> $subject = 'How to activate your login';
> $this->setMessage();
> $this->saveToken();
> mail($to, $subject, $this->_message);
46,53c46,52
< $sql = sprintf(
< "SELECT id FROM auth_users WHERE email='%s'",
< $this->_emailAddress);
<
< $res = $this->_mysqli->query($sql);
< $row = $res->fetch_row();
<
< return $row[0];
---
> $sql = sprintf(
> "SELECT id FROM auth_users WHERE email='%s'",
> $this->_emailAddress);
>
> $res = $this->_mysqli->query($sql);
> $row = $res->fetch_row();
> return $row[0];
65c64
< $this->_message = "Please click on the following link to reset your
---
> $this->_message = "Please click on the following link to reset your
88c87
< "DELETE FROM one_time_token
---
> "DELETE FROM one_time_token
99c98
< $this->_emailAddress,
---
> $this->_emailAddress,
105a105
>
diff -r -x .git current.lloyd/public_html/lib/RouteAuth.php current.sundbp/public_html/lib/RouteAuth.php
4c4
< private $_xml;
---
> private $_xml;
6,33c6,32
< public function __construct($xml)
< {
< $xml = $this->xml2Array($xml);
< $this->_xml = $xml;
< }
<
< private function xml2Array($xmlFile)
< {
< $xml = file_get_contents($xmlFile);
< $xml = simplexml_load_string($xml);
< $xml = json_decode(json_encode($xml));
<
< $xmlAsArray = $this->objectAsArray($xml);
<
< return $xmlAsArray;
< }
<
< private function objectAsArray($elm)
< {
< if (is_object($elm)) {
< $elm = get_object_vars($elm);
< }
<
< if (is_array($elm)) {
< return array_map(__METHOD__, $elm);
< } else {
< return $elm;
< }
---
> public function __construct($xml)
> {
> $xml = $this->xml2Array($xml);
> $this->_xml = $xml;
> }
>
> private function xml2Array($xmlFile)
> {
> $xml = file_get_contents($xmlFile);
> $xml = simplexml_load_string($xml);
> $xml = json_decode(json_encode($xml));
>
> $xmlAsArray = $this->objectAsArray($xml);
> return $xmlAsArray;
> }
>
> private function objectAsArray($elm)
> {
> if (is_object($elm)) {
> $elm = get_object_vars($elm);
> }
>
> if (is_array($elm)) {
> return array_map(__METHOD__, $elm);
> } else {
> return $elm;
> }
35c34
< }
---
> }
36a36,37
>
>
diff -r -x .git current.lloyd/public_html/localconfig.inc.php current.sundbp/public_html/localconfig.inc.php
2,5c2,5
< $BASE_URL = "";
< $BASE_DIR = "/boardiq";
< $STORAGE_BASE = "/boardiq-files";
< $WEBSITE_URL = "localhost{$BASE_URL}";
---
> $BASE_URL = "";
> $BASE_DIR = "/boardiq/current";
> $STORAGE_BASE = "/boardiq-files";
> $WEBSITE_URL = "localhost{$BASE_URL}";
7,14c7,14
< $LIBRARYDIR = "{$STORAGE_BASE}/files_library"; // root directory for the doc library
< $TEMPLATEDIR = "{$STORAGE_BASE}/files_templates"; // directory for BI-uploaded OO templates
< $DATASHEETDIR = "{$STORAGE_BASE}/files_datasheets"; // directory for created input dataset templates
< $USERDATADIR = "{$STORAGE_BASE}/files_userdata"; // directory for user supplied data files (CSVs)
< $USERCOMMENTARYDIR = "{$STORAGE_BASE}/files_usercommentary"; // directory for generated user commentary files
< $GENERATEDPACKDIR = "{$STORAGE_BASE}/files_packs";
< $PACKSTYLESDIR = "{$STORAGE_BASE}/files_styles";
< $DOCREPOSITORYDIR = "{$STORAGE_BASE}/files_repo";
---
> $LIBRARYDIR = "{$STORAGE_BASE}/files_library"; // root directory for the doc library
> $TEMPLATEDIR = "{$STORAGE_BASE}/files_templates"; // directory for BI-uploaded OO templates
> $DATASHEETDIR = "{$STORAGE_BASE}/files_datasheets"; // directory for created input dataset templates
> $USERDATADIR = "{$STORAGE_BASE}/files_userdata"; // directory for user supplied data files (CSVs)
> $USERCOMMENTARYDIR = "{$STORAGE_BASE}/files_usercommentary"; // directory for generated user commentary files
> $GENERATEDPACKDIR = "{$STORAGE_BASE}/files_packs";
> $PACKSTYLESDIR = "{$STORAGE_BASE}/files_styles";
> $DOCREPOSITORYDIR = "{$STORAGE_BASE}/files_repo";
16,19c16,19
< $SQL_HOST = "localhost";
< $SQL_USER = "boardiq";
< $SQL_PASS = "boardiq1intel2biz";
< $SQL_DB = "boardiq";
---
> $SQL_HOST = "localhost";
> $SQL_USER = "boardiq";
> $SQL_PASS = "boardiq1intel2biz";
> $SQL_DB = "boardiq";
diff -r -x .git current.lloyd/templates/admin/index.tpl current.sundbp/templates/admin/index.tpl
28c28
< <h1>Pack Shelves </h1>
---
> <h1>Pack Shelves A CHANGE</h1>
30c30
< <tr><th>Listing</th><th>Client</th><th>Shelf Name</th><th>Date Added</th></tr>
---
> <tr><th>Client</th><th>Shelf Name</th><th>Date Added</th></tr>
32c32
< <tr><td>{$f->listing}</td><td>{$f->client->companyname|escape}</td><td>{$f->name|escape}</td><td>{$f->added|date_format:'%d/%m/%Y'}</td></tr>
---
> <tr><td>{$f->client->companyname|escape}</td><td>{$f->name|escape}</td><td>{$f->added|date_format:'%d/%m/%Y'}</td></tr>
Only in current.lloyd/: test.php
Only in current.lloyd/: .vagrant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment