1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
stssync.php
См. документацию.
1<?php
3
4use Bitrix\Intranet\OutlookApplication;
11
13{
14 const SERVICE_PATH = '/stssync/';
15
16 public static function getUrl($type, $servicePath, $linkUrl, $prefix, $name, $guid)
17 {
18 \CJSCore::Init(array('stssync'));
19
20 $port = Context::getCurrent()->getRequest()->isHttps() ? 443 : 80;
21
22 if(Loader::includeModule('ldap'))
23 {
25 }
26
27 return 'BX.StsSync.sync(\''.$type.'\', \''.static::SERVICE_PATH.$servicePath.'\', \''.\CUtil::jsEscape($linkUrl).'\', \''.\CUtil::jsEscape($prefix).'\', \''.\CUtil::jsEscape($name).'\', \''.$guid.'\', '.intval($port).')';
28 }
29
30 public static function checkAuth($userId, $ap)
31 {
32 global $USER;
33
34 if(Loader::includeModule('intranet'))
35 {
36 $appPassword = ApplicationPasswordTable::findPassword($userId, $ap);
37 if($appPassword !== false)
38 {
39 if($appPassword["APPLICATION_ID"] === OutlookApplication::ID)
40 {
41 $appManager = ApplicationManager::getInstance();
42 if($appManager->checkScope($appPassword["APPLICATION_ID"]) === true)
43 {
44 ApplicationPasswordTable::update($appPassword["ID"], array(
45 'DATE_LOGIN' => new DateTime(),
46 'LAST_IP' => Context::getCurrent()->getRequest()->getRemoteAddress(),
47 ));
48
49 setSessionExpired(true);
50 return $USER->Authorize($userId);
51 }
52 }
53 }
54 }
55
56 return false;
57 }
58
59 public static function getAuth($type = '')
60 {
61 if(Loader::includeModule('intranet'))
62 {
63 return \Bitrix\Intranet\OutlookApplication::generateAppPassword($type);
64 }
65 else
66 {
67 return false;
68 }
69 }
70}
$type
Определения options.php:106
Определения loader.php:13
static getUrl($type, $servicePath, $linkUrl, $prefix, $name, $guid)
Определения stssync.php:16
const SERVICE_PATH
Определения stssync.php:14
static Init($arExt=array(), $bReturn=false)
Определения jscore.php:66
static getTargetPort($serverPort=false)
Определения ldap_util.php:485
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$name
Определения menu_edit.php:35
Определения culture.php:9
Определения stssync.php:2