Browse Source

- More iCal calendar work
- Merge branch 'v2-develop' of https://github.com/causefx/Organizr into v2-develop

Rob Gökemeijer 8 years ago
parent
commit
de22ee33bb

+ 2 - 1
api/config/default.php

@@ -146,5 +146,6 @@ return array(
 	'mediaSearch' => false,
 	'mediaSearchType' => '',
 	'mediaSearchAuth' => '1',
-	'registrationPassword' => ''
+	'registrationPassword' => '',
+	'hideRegistration' => false
 );

+ 3 - 0
api/functions/auth-functions.php

@@ -1,6 +1,9 @@
 <?php
 function authRegister($username, $password, $defaults, $email)
 {
+	if ($GLOBALS['authBackend'] !== '') {
+		ombiImport($GLOBALS['authBackend']);
+	}
 	if (createUser($username, $password, $defaults, $email)) {
 		writeLog('success', 'Registration Function - A User has registered', $username);
 		if ($GLOBALS['PHPMAILER-enabled']) {

+ 32 - 0
api/functions/homepage-connect-functions.php

@@ -1501,6 +1501,38 @@ function ombiAPI($array)
 	return ombiAction($array['data']['id'], $array['data']['action'], $array['data']['type']);
 }
 
+function ombiImport($type = null)
+{
+	if (!empty($GLOBALS['ombiURL']) && !empty($GLOBALS['ombiToken']) && !empty($type)) {
+		try {
+			$url = qualifyURL($GLOBALS['ombiURL']);
+			$headers = array(
+				"Accept" => "application/json",
+				"Content-Type" => "application/json",
+				"Apikey" => $GLOBALS['ombiToken']
+			);
+			$options = (localURL($url)) ? array('verify' => false) : array();
+			switch ($type) {
+				case 'emby':
+					$response = Requests::get($url . "/api/v1/Job/embyuserimporter", $headers, $options);
+					break;
+				case 'plex':
+					$response = Requests::get($url . "/api/v1/Job/plexuserimporter", $headers, $options);
+					break;
+				default:
+					break;
+			}
+			if ($response->success) {
+				writeLog('success', 'OMBI Connect Function - Ran User Import', 'SYSTEM');
+				return true;
+			}
+		} catch (Requests_Exception $e) {
+			writeLog('error', 'OMBI Connect Function - Error: ' . $e->getMessage(), 'SYSTEM');
+		};
+	}
+	return false;
+}
+
 function ombiAction($id, $action, $type)
 {
 	if ($GLOBALS['homepageOmbiEnabled'] && !empty($GLOBALS['ombiURL']) && !empty($GLOBALS['ombiToken']) && qualifyRequest($GLOBALS['homepageOmbiAuth'])) {

File diff suppressed because it is too large
+ 568 - 651
api/functions/homepage-functions.php


+ 13 - 0
api/functions/organizr-functions.php

@@ -414,6 +414,12 @@ function getSettingsMain()
 				'label' => 'Registration Password',
 				'value' => $GLOBALS['registrationPassword'],
 			),
+			array(
+				'type' => 'switch',
+				'name' => 'hideRegistration',
+				'label' => 'Hide Registration',
+				'value' => $GLOBALS['hideRegistration']
+			)
 		)
 	);
 }
@@ -885,6 +891,13 @@ function logoOrText()
 	}
 }
 
+function showLogin()
+{
+	if ($GLOBALS['hideRegistration'] == false) {
+		return '<p><span lang="en">Don\'t have an account?</span><a href="#" class="text-primary m-l-5 to-register"><b lang="en">Sign Up</b></a></p>';
+	}
+}
+
 function getImages()
 {
 	$dirname = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'tabs' . DIRECTORY_SEPARATOR;

+ 2 - 3
api/pages/login.php

@@ -1,5 +1,4 @@
 <?php
-
 $pageLogin = '
 <script>
 </script>
@@ -7,7 +6,7 @@ $pageLogin = '
   <div class="login-box login-sidebar animated slideInRight">
     <div class="white-box">
       <form class="form-horizontal form-material" id="loginform" onsubmit="return false;">
-        <a href="javascript:void(0)" class="text-center db visible-xs" id="login-logo">'.logoOrText().'</a>
+        <a href="javascript:void(0)" class="text-center db visible-xs" id="login-logo">' . logoOrText() . '</a>
 
         <div class="form-group m-t-40">
           <div class="col-xs-12">
@@ -35,7 +34,7 @@ $pageLogin = '
 
         <div class="form-group m-b-0">
           <div class="col-sm-12 text-center">
-            <p><span lang="en">Don\'t have an account?</span><a href="#" class="text-primary m-l-5 to-register"><b lang="en">Sign Up</b></a></p>
+            ' . showLogin() . '
           </div>
         </div>
       </form>

+ 1 - 1
api/plugins/php-mailer.php

@@ -167,10 +167,10 @@ function phpmSendEmail($emailInfo)
 		//$mail->SMTPDebug = 3;
 		$mail->Host = $GLOBALS['PHPMAILER-smtpHost'];
 		$mail->Port = $GLOBALS['PHPMAILER-smtpHostPort'];
-		$mail->SMTPSecure = $GLOBALS['PHPMAILER-smtpHostType'];
 		if ($GLOBALS['PHPMAILER-smtpHostType'] !== 'n/a') {
 			$mail->SMTPSecure = $GLOBALS['PHPMAILER-smtpHostType'];
 		}
+		$mail->SMTPAuth = $GLOBALS['PHPMAILER-smtpHostAuth'];
 		$mail->Username = $GLOBALS['PHPMAILER-smtpHostUsername'];
 		$mail->Password = decrypt($GLOBALS['PHPMAILER-smtpHostPassword']);
 		$mail->SMTPOptions = array(

+ 8 - 1
js/custom.js

@@ -209,7 +209,14 @@ function pageLoad(){
                     this.st.focus = '#name';
                 }
                 this.st.mainClass = this.st.el.attr('data-effect');
-            }
+            },
+            beforeClose: function() {
+                // Callback available since v0.9.0
+                if(!$.magnificPopup.instance.currItem.inlineElement.find('.rubberBand').hasClass('hidden')){
+                    var magIndex = $.magnificPopup.instance.currItem.index;
+                    message('You forgot to save','<a class="mouse" onclick="$(\'.popup-with-form\').magnificPopup(\'open\','+magIndex+')">Would you like to go back?</a>','bottom-right','#FFF','warning','5000');
+                }
+            },
         }
     });
     // Inline popups

Some files were not shown because too many files changed in this diff