@@ -25,21 +25,21 @@ |
||
| 25 | 25 | echo "Sending for intranet ".$row['name'].": "; |
| 26 | 26 | |
| 27 | 27 | $auth_adapter = new Intraface_Auth_PublicKeyLogin($db, md5(uniqid()), $row['public_key']); |
| 28 | - $weblogin = $auth_adapter->auth(); |
|
| 28 | + $weblogin = $auth_adapter->auth(); |
|
| 29 | 29 | |
| 30 | - if (!$weblogin) {
|
|
| 31 | - throw new Exception('Access to the intranet denied. The private key is probably wrong.');
|
|
| 32 | - } |
|
| 30 | + if (!$weblogin) {
|
|
| 31 | + throw new Exception('Access to the intranet denied. The private key is probably wrong.');
|
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | 34 | $kernel = new Intraface_Kernel(); |
| 35 | 35 | $kernel->intranet = new Intraface_Intranet($weblogin->getActiveIntranetId()); |
| 36 | 36 | $kernel->setting = new Intraface_Setting($kernel->intranet->get('id'));
|
| 37 | 37 | |
| 38 | - $kernel->useShared('email');
|
|
| 38 | + $kernel->useShared('email');
|
|
| 39 | 39 | |
| 40 | - if (!$kernel->intranet->hasModuleAccess('contact')) {
|
|
| 41 | - continue; |
|
| 42 | - } |
|
| 40 | + if (!$kernel->intranet->hasModuleAccess('contact')) {
|
|
| 41 | + continue; |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | 44 | $gateway = new Intraface_shared_email_EmailGateway($kernel); |
| 45 | 45 | $mails = $gateway->getEmailsToSend(); |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | $filehandler = new FileHandler($kernel, $file['id']); |
| 68 | 68 | |
| 69 | 69 | // lille hack med at s�tte uploadpath p� |
| 70 | - $attachment = Swift_Attachment::fromPath($filehandler->getUploadPath() . $filehandler->get('server_file_name'), $filehandler->get('file_type'))->setFilename($file['filename']);
|
|
| 70 | + $attachment = Swift_Attachment::fromPath($filehandler->getUploadPath().$filehandler->get('server_file_name'), $filehandler->get('file_type'))->setFilename($file['filename']);
|
|
| 71 | 71 | $message->attach($attachment); |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -72,9 +72,13 @@ |
||
| 72 | 72 | $contacts = $contact->getList(); |
| 73 | 73 | $i = 0; |
| 74 | 74 | foreach ($contacts as $contact) { |
| 75 | - if (empty($contact['email'])) continue; |
|
| 76 | - if ($subscriber->addContact(new Contact($kernel, $contact['id']))) $i++; |
|
| 77 | -} |
|
| 75 | + if (empty($contact['email'])) { |
|
| 76 | + continue; |
|
| 77 | + } |
|
| 78 | + if ($subscriber->addContact(new Contact($kernel, $contact['id']))) { |
|
| 79 | + $i++; |
|
| 80 | + } |
|
| 81 | + } |
|
| 78 | 82 | echo $i; |
| 79 | 83 | |
| 80 | 84 | |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | continue; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - echo $debtor['id'] . ' order set as sent'; |
|
| 54 | + echo $debtor['id'].' order set as sent'; |
|
| 55 | 55 | $d = Debtor::factory($kernel, $debtor['id']); |
| 56 | 56 | $d->setStatus('sent'); |
| 57 | 57 | |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | while ($row = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) { |
| 46 | - echo $row['number']. ', ' . $row['id']. ', ' . $row['date_created'] . ', '.$row['email']. ', '. $row['name']. ', '; |
|
| 46 | + echo $row['number'].', '.$row['id'].', '.$row['date_created'].', '.$row['email'].', '.$row['name'].', '; |
|
| 47 | 47 | |
| 48 | - $newsletter = $db->query('SELECT id FROM newsletter_subscriber WHERE contact_id = '. $row['id']); |
|
| 48 | + $newsletter = $db->query('SELECT id FROM newsletter_subscriber WHERE contact_id = '.$row['id']); |
|
| 49 | 49 | if ($newsletter->numRows() == 0) { |
| 50 | 50 | $subscriber = new NewsletterSubscriber($list); |
| 51 | 51 | $contact = new Contact($kernel, $row['id']); |
@@ -60,6 +60,6 @@ discard block |
||
| 60 | 60 | $i++; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | -echo $i. " number of contacts"; |
|
| 63 | +echo $i." number of contacts"; |
|
| 64 | 64 | |
| 65 | 65 | ?> |
| 66 | 66 | \ No newline at end of file |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | if (empty($opts->k) OR empty($opts->fk) OR empty($opts->ft) OR empty($opts->t)) { |
| 20 | - echo 'not used correctly' . "\n"; |
|
| 20 | + echo 'not used correctly'."\n"; |
|
| 21 | 21 | exit(1); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -126,6 +126,9 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | + /** |
|
| 130 | + * @param string $f |
|
| 131 | + */ |
|
| 129 | 132 | function deleteUploadDirectory($f) |
| 130 | 133 | { |
| 131 | 134 | if ( is_dir( $f ) ){ |
@@ -142,6 +145,7 @@ discard block |
||
| 142 | 145 | |
| 143 | 146 | /** |
| 144 | 147 | * grants access to given modules |
| 148 | + * @param string $modules |
|
| 145 | 149 | */ |
| 146 | 150 | public function grantModuleAccess($modules) |
| 147 | 151 | { |
@@ -234,6 +238,7 @@ discard block |
||
| 234 | 238 | |
| 235 | 239 | /** |
| 236 | 240 | * splits a mysql export into separate |
| 241 | + * @param string $sql |
|
| 237 | 242 | */ |
| 238 | 243 | static function splitSql($sql) |
| 239 | 244 | { |
@@ -26,13 +26,13 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | function dropDatabase() |
| 28 | 28 | { |
| 29 | - $result = $this->db->query("SHOW TABLES FROM " . DB_NAME); |
|
| 29 | + $result = $this->db->query("SHOW TABLES FROM ".DB_NAME); |
|
| 30 | 30 | if (PEAR::isError($result)) { |
| 31 | 31 | throw new Exception($result->getUserInfo()); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | while ($line = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) { |
| 35 | - $drop = $this->db->exec('DROP TABLE ' . $line['tables_in_' . DB_NAME]); |
|
| 35 | + $drop = $this->db->exec('DROP TABLE '.$line['tables_in_'.DB_NAME]); |
|
| 36 | 36 | if (PEAR::IsError($drop)) { |
| 37 | 37 | throw new Exception($drop->getUserInfo()); |
| 38 | 38 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | function createDatabaseSchema() |
| 44 | 44 | { |
| 45 | - $sql_structure = file_get_contents(dirname(__FILE__) . '/database-structure.sql'); |
|
| 45 | + $sql_structure = file_get_contents(dirname(__FILE__).'/database-structure.sql'); |
|
| 46 | 46 | $sql_arr = Intraface_Install::splitSql($sql_structure); |
| 47 | 47 | |
| 48 | 48 | foreach ($sql_arr as $sql) { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - $sql_structure = file_get_contents(dirname(__FILE__) . '/database-update.sql'); |
|
| 56 | + $sql_structure = file_get_contents(dirname(__FILE__).'/database-update.sql'); |
|
| 57 | 57 | $sql_arr = Intraface_Install::splitSql($sql_structure); |
| 58 | 58 | |
| 59 | 59 | foreach ($sql_arr as $sql) { |
@@ -68,12 +68,12 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | function emptyDatabase() |
| 70 | 70 | { |
| 71 | - $result = $this->db->query("SHOW TABLES FROM " . DB_NAME); |
|
| 71 | + $result = $this->db->query("SHOW TABLES FROM ".DB_NAME); |
|
| 72 | 72 | if (PEAR::isError($result)) { |
| 73 | 73 | throw new Exception($result->getUserInfo()); |
| 74 | 74 | } |
| 75 | 75 | while ($line = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) { |
| 76 | - $truncate = $this->db->exec('TRUNCATE TABLE ' . $line['Tables_in_'.DB_NAME]); |
|
| 76 | + $truncate = $this->db->exec('TRUNCATE TABLE '.$line['Tables_in_'.DB_NAME]); |
|
| 77 | 77 | if (PEAR::IsError($truncate)) { |
| 78 | 78 | throw new Exception($truncate->getUserInfo()); |
| 79 | 79 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | function createStartingValues() |
| 86 | 86 | { |
| 87 | - $sql_values = file_get_contents(dirname(__FILE__) . '/database-values.sql'); |
|
| 87 | + $sql_values = file_get_contents(dirname(__FILE__).'/database-values.sql'); |
|
| 88 | 88 | $sql_arr = Intraface_Install::splitSql($sql_values); |
| 89 | 89 | |
| 90 | 90 | foreach ($sql_arr as $sql) { |
@@ -128,15 +128,15 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | function deleteUploadDirectory($f) |
| 130 | 130 | { |
| 131 | - if ( is_dir( $f ) ){ |
|
| 132 | - foreach ( scandir( $f ) as $item ){ |
|
| 133 | - if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) ) |
|
| 131 | + if (is_dir($f)) { |
|
| 132 | + foreach (scandir($f) as $item) { |
|
| 133 | + if (!strcmp($item, '.') || !strcmp($item, '..')) |
|
| 134 | 134 | continue; |
| 135 | - $this->deleteUploadDirectory( $f . "/" . $item ); |
|
| 135 | + $this->deleteUploadDirectory($f."/".$item); |
|
| 136 | 136 | } |
| 137 | - rmdir( $f ); |
|
| 138 | - } else{ |
|
| 139 | - @unlink( $f ); |
|
| 137 | + rmdir($f); |
|
| 138 | + } else { |
|
| 139 | + @unlink($f); |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $object_method[0] = str_replace('/', '', $object_method[0]); |
| 216 | 216 | $object_method[0] = str_replace('\\', '', $object_method[0]); |
| 217 | 217 | |
| 218 | - require_once dirname(__FILE__) . '/Helper/'.$object_method[0].'.php'; |
|
| 218 | + require_once dirname(__FILE__).'/Helper/'.$object_method[0].'.php'; |
|
| 219 | 219 | $object_name = 'Install_Helper_'.$object_method[0]; |
| 220 | 220 | $object = new $object_name($kernel, $this->db); |
| 221 | 221 | $object->$object_method[1](); |
@@ -130,8 +130,9 @@ |
||
| 130 | 130 | { |
| 131 | 131 | if ( is_dir( $f ) ){ |
| 132 | 132 | foreach ( scandir( $f ) as $item ){ |
| 133 | - if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) ) |
|
| 134 | - continue; |
|
| 133 | + if ( !strcmp( $item, '.' ) || !strcmp( $item, '..' ) ) { |
|
| 134 | + continue; |
|
| 135 | + } |
|
| 135 | 136 | $this->deleteUploadDirectory( $f . "/" . $item ); |
| 136 | 137 | } |
| 137 | 138 | rmdir( $f ); |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * Public: henter beløbet efter konvertering |
| 52 | - * @return beløb |
|
| 52 | + * @return double |
|
| 53 | 53 | */ |
| 54 | 54 | function get() |
| 55 | 55 | { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | /** |
| 44 | 44 | * hasIdentity() |
| 45 | 45 | * |
| 46 | - * @return mixed user id or false |
|
| 46 | + * @return boolean user id or false |
|
| 47 | 47 | */ |
| 48 | 48 | public function hasIdentity() |
| 49 | 49 | { |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | /** |
| 84 | 84 | * Implements the observer pattern |
| 85 | 85 | * |
| 86 | - * @param object $observer |
|
| 86 | + * @param Intraface_Log $observer |
|
| 87 | 87 | * |
| 88 | 88 | * @return boolean |
| 89 | 89 | */ |
@@ -32,9 +32,9 @@ |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | if ($object = $adapter->auth()) { |
| 35 | - $this->notifyObservers('login', $identification . ' logged in'); |
|
| 35 | + $this->notifyObservers('login', $identification.' logged in'); |
|
| 36 | 36 | } else { |
| 37 | - $this->notifyObservers('login', $identification . ' could not login'); |
|
| 37 | + $this->notifyObservers('login', $identification.' could not login'); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | return $object; |
@@ -54,6 +54,10 @@ |
||
| 54 | 54 | return $this->render(); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | + /** |
|
| 58 | + * @param string $username |
|
| 59 | + * @param string $password |
|
| 60 | + */ |
|
| 57 | 61 | protected function selectUser($username, $password) |
| 58 | 62 | { |
| 59 | 63 | $adapter = new Intraface_Auth_User($this->mdb2, $this->session()->sessionId(), $username, $password); |