Skip to content

Commit

Permalink
build v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sualko committed Feb 14, 2017
1 parent a92cf4d commit d1c1486
Show file tree
Hide file tree
Showing 42 changed files with 2,846 additions and 44,688 deletions.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>ojsxc</id>
<name>JavaScript XMPP Chat</name>
<description>Facebook-like chat with end-to-end encrypted conversation, video calls, multi-user rooms, XMPP and internal server backend.</description>
<version>3.1.0-beta</version>
<version>3.1.0</version>
<licence>MIT</licence>
<author>Klaus Herberth, Tobia De Koninck</author>
<requiremin>8.0</requiremin>
Expand Down
2 changes: 1 addition & 1 deletion appinfo/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.0-beta
3.1.0
21 changes: 12 additions & 9 deletions build/ajax/getSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,23 @@ function validateBoolean($val)

OCP\JSON::callCheck();

$username = $_POST ['username'];
$password = $_POST ['password'];
$currentUser = false;

$ocUser = new OCP\User();

$auth = ($password !== null) ? $ocUser->checkPassword($username, $password) : OCP\User::isLoggedIn();
if(!empty($_POST['password']) && !empty($_POST['username'])) {
$currentUser = \OC::$server->getUserManager()->checkPassword($_POST['username'], $_POST['password']);
} else if (OCP\User::isLoggedIn()) {
$currentUser = \OC::$server->getUserSession()->getUser();
}

if (!$auth) {
if (!$currentUser) {
echo json_encode(array(
'result' => 'noauth',
));
exit();
}

$currentUID = $currentUser->getUID();

$config = \OC::$server->getConfig();

$data = array();
Expand All @@ -46,10 +49,10 @@ function validateBoolean($val)
$data ['xmpp'] ['domain'] = trim($config->getAppValue('ojsxc', 'xmppDomain'));
$data ['xmpp'] ['resource'] = trim($config->getAppValue('ojsxc', 'xmppResource'));
$data ['xmpp'] ['overwrite'] = validateBoolean($config->getAppValue('ojsxc', 'xmppOverwrite'));
$data ['xmpp'] ['onlogin'] = true;
$data ['xmpp'] ['onlogin'] = null;

if (validateBoolean($config->getAppValue('ojsxc', 'xmppPreferMail'))) {
$mail = $config->getUserValue($username,'settings','email');
$mail = $config->getUserValue($currentUID,'settings','email');

if ($mail !== null) {
list($u, $d) = explode("@", $mail, 2);
Expand All @@ -60,7 +63,7 @@ function validateBoolean($val)
}
}

$options = $config->getUserValue($username, 'ojsxc', 'options');
$options = $config->getUserValue($currentUID, 'ojsxc', 'options');

if ($options !== null) {
$options = (array) json_decode($options, true);
Expand Down
8 changes: 8 additions & 0 deletions build/ajax/setAdminSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@
$config->setAppValue('ojsxc', 'firefoxExtension', $_POST ['firefoxExtension']);
$config->setAppValue('ojsxc', 'chromeExtension', $_POST ['chromeExtension']);

$externalServices = array();
foreach($_POST['externalServices'] as $es) {
if (preg_match('/^(https:\/\/)?([\w\d*][\w\d-]*)(\.[\w\d-]+)+(:[\d]+)?$/', $es)) {
$externalServices[] = $es;
}
}
$config->setAppValue('ojsxc', 'externalServices', implode('|', $externalServices));

echo 'true';
7 changes: 7 additions & 0 deletions build/appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@
$policy->addAllowedConnectDomain($boshDomain);
}

$externalServices = \OC::$server->getConfig()->getAppValue('ojsxc', 'externalServices');
$externalServices = explode("|", $externalServices);

foreach($externalServices as $es) {
$policy->addAllowedConnectDomain($es);
}

$manager->addDefaultPolicy($policy);
}

Expand Down
2 changes: 1 addition & 1 deletion build/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>ojsxc</id>
<name>JavaScript XMPP Chat</name>
<description>Facebook-like chat with end-to-end encrypted conversation, video calls, multi-user rooms, XMPP and internal server backend.</description>
<version>3.1.0-beta</version>
<version>3.1.0</version>
<licence>MIT</licence>
<author>Klaus Herberth, Tobia De Koninck</author>
<requiremin>8.0</requiremin>
Expand Down
2 changes: 1 addition & 1 deletion build/appinfo/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.0-beta
3.1.0
Loading

0 comments on commit d1c1486

Please sign in to comment.