From 36907c327c86f8ce1f8b76cffce9556e23b364cd Mon Sep 17 00:00:00 2001 From: AfterLogic Support Date: Mon, 25 Apr 2016 16:47:17 +0300 Subject: [PATCH] WebMail Lite 7.6.8 --- LICENSE | 1320 +-- VERSION | 2 +- adminpanel/VERSION | 2 +- adminpanel/core/cadminpanel.php | 2632 ++--- adminpanel/core/modules.php | 1078 +- adminpanel/core/screens/login.php | 98 +- adminpanel/core/screens/simple.php | 40 +- adminpanel/core/templates/error.php | 50 +- adminpanel/core/templates/login-warning.php | 4 +- adminpanel/core/templates/login.php | 94 +- adminpanel/core/templates/main.php | 58 +- adminpanel/core/templates/standard.php | 38 +- adminpanel/core/templates/table-main.php | 34 +- adminpanel/core/templates/table.php | 80 +- adminpanel/core/utils.php | 468 +- adminpanel/index.php | 14 +- adminpanel/modules/common/inc/constants.php | 1 - adminpanel/modules/common/inc/populate.php | 326 +- adminpanel/modules/common/inc/post.php | 304 +- adminpanel/modules/common/index.php | 1424 +-- adminpanel/modules/common/js/db.js | 22 +- .../main-edit-domain-general-webmail.php | 132 +- .../modules/common/templates/security.php | 66 +- .../common/templates/social-aurora.php | 74 +- .../common/templates/social-footer.php | 12 +- .../common/templates/social-header.php | 12 +- .../modules/common/templates/social.php | 108 +- adminpanel/modules/webmail/inc/blank.php | 20 +- adminpanel/modules/webmail/inc/constants.php | 58 +- adminpanel/modules/webmail/js/domains.js | 50 +- adminpanel/modules/webmail/js/system.js | 42 +- adminpanel/static/js/common.js | 1444 +-- adminpanel/static/js/jquery.js | 6 +- adminpanel/static/js/knockout-2.3.0.js | 176 +- adminpanel/static/js/screens/table.js | 988 +- adminpanel/static/styles/screens/login.css | 6 +- adminpanel/static/styles/screens/standard.css | 2 +- .../external-services/i18n/Estonian.ini | 16 + .../i18n/Estonian.ini | 29 + data/settings/config.php | 48 +- favicon-single-compose.ico | Bin 318 -> 0 bytes i18n/Arabic.ini | 4 +- i18n/Bulgarian.ini | 4 +- i18n/Chinese-Simplified.ini | 4 +- i18n/Chinese-Traditional.ini | 4 +- i18n/Czech.ini | 10 +- i18n/Danish.ini | 4 +- i18n/English.ini | 4 +- i18n/Estonian.ini | 1758 ++-- i18n/Finnish.ini | 4 +- i18n/French.ini | 4 +- i18n/German.ini | 4 +- i18n/Greek.ini | 4 +- i18n/Hebrew.ini | 4 +- i18n/Hungarian.ini | 4 +- i18n/Italian.ini | 10 +- i18n/Japanese.ini | 4 +- i18n/Korean.ini | 4 +- i18n/Latvian.ini | 4 +- i18n/Lithuanian.ini | 4 +- i18n/Norwegian.ini | 4 +- i18n/Persian.ini | 4 +- i18n/Polish.ini | 10 +- i18n/Portuguese-Brazil.ini | 4 +- i18n/Portuguese-Portuguese.ini | 4 +- i18n/Romanian.ini | 4 +- i18n/Russian.ini | 4 +- i18n/Serbian.ini | 4 +- i18n/Slovenian.ini | 4 +- i18n/Spanish.ini | 10 +- i18n/Swedish.ini | 4 +- i18n/Thai.ini | 4 +- i18n/Turkish.ini | 4 +- i18n/Ukrainian.ini | 4 +- i18n/Vietnamese.ini | 4 +- index.php | 2 +- install/index.php | 20 +- install/installer.php | 568 +- install/js/jquery.js | 308 +- install/steps/compatibility.php | 608 +- install/steps/completed.php | 30 +- install/steps/license.php | 30 +- install/templates/admin-panel.html | 84 +- install/templates/completed.html | 32 +- install/templates/email-server-test.html | 88 +- install/templates/nav-line.html | 4 +- .../Exception/FileAlreadyExistsException.php | 10 +- libraries/Knp/Snappy/GeneratorInterface.php | 110 +- libraries/Knp/Snappy/Image.php | 160 +- libraries/Knp/Snappy/Pdf.php | 396 +- libraries/Knp/Snappy/Process.php | 204 +- libraries/MailSo/Base/Crypt.php | 362 +- libraries/MailSo/Base/DateTimeHelper.php | 164 +- .../MailSo/Base/Exceptions/Exception.php | 52 +- .../Exceptions/InvalidArgumentException.php | 24 +- libraries/MailSo/Base/ResourceRegistry.php | 236 +- .../MailSo/Base/StreamWrappers/Binary.php | 808 +- .../MailSo/Base/StreamWrappers/Literal.php | 374 +- .../MailSo/Base/StreamWrappers/SubStreams.php | 548 +- libraries/MailSo/Base/StreamWrappers/Test.php | 262 +- libraries/MailSo/Base/Validator.php | 186 +- libraries/MailSo/Config.php | 122 +- libraries/MailSo/Imap/BodyStructure.php | 1840 ++-- .../MailSo/Imap/Enumerations/FetchType.php | 240 +- .../Enumerations/FolderResponseStatus.php | 38 +- .../MailSo/Imap/Enumerations/FolderStatus.php | 38 +- .../MailSo/Imap/Enumerations/FolderType.php | 46 +- .../MailSo/Imap/Enumerations/MessageFlag.php | 40 +- .../Imap/Enumerations/ResponseStatus.php | 38 +- .../MailSo/Imap/Enumerations/ResponseType.php | 36 +- .../MailSo/Imap/Enumerations/StoreAction.php | 54 +- .../MailSo/Imap/Exceptions/Exception.php | 24 +- .../Exceptions/InvalidResponseException.php | 24 +- .../LoginBadCredentialsException.php | 22 +- .../Exceptions/LoginBadMethodException.php | 22 +- .../MailSo/Imap/Exceptions/LoginException.php | 24 +- .../Exceptions/NegativeResponseException.php | 24 +- .../Imap/Exceptions/ResponseException.php | 100 +- .../Exceptions/ResponseNotFoundException.php | 24 +- .../Imap/Exceptions/RuntimeException.php | 24 +- libraries/MailSo/Imap/Folder.php | 372 +- libraries/MailSo/Imap/FolderInformation.php | 194 +- libraries/MailSo/Imap/ImapClient.php | 5060 +++++----- libraries/MailSo/Imap/Response.php | 194 +- libraries/MailSo/Log/Drivers/File.php | 178 +- libraries/MailSo/Log/Drivers/Inline.php | 174 +- libraries/MailSo/Log/Enumerations/Type.php | 54 +- libraries/MailSo/Log/Logger.php | 696 +- .../MailSo/Mail/AttachmentCollection.php | 200 +- .../MailSo/Mail/Exceptions/Exception.php | 24 +- .../MailSo/Mail/Exceptions/NonEmptyFolder.php | 24 +- .../Mail/Exceptions/RuntimeException.php | 24 +- libraries/MailSo/Mail/Folder.php | 618 +- libraries/MailSo/Mime/Enumerations/Header.php | 124 +- .../Mime/Enumerations/MessagePriority.php | 34 +- .../MailSo/Mime/Enumerations/Parameter.php | 38 +- .../MailSo/Mime/Enumerations/Sensitivity.php | 36 +- libraries/MailSo/Mime/Header.php | 624 +- libraries/MailSo/Mime/Parser/ParserEmpty.php | 148 +- .../MailSo/Mime/Parser/ParserInterface.php | 118 +- libraries/MailSo/Mime/Parser/ParserMemory.php | 92 +- libraries/MailSo/Mime/PartCollection.php | 116 +- .../Enumerations/ConnectionSecurityType.php | 126 +- .../Net/Exceptions/ConnectionException.php | 24 +- libraries/MailSo/Net/Exceptions/Exception.php | 24 +- .../Exceptions/InvalidArgumentException.php | 24 +- .../SocketAlreadyConnectedException.php | 24 +- .../SocketCanNotConnectToHostException.php | 108 +- ...ketConnectionDoesNotAvailableException.php | 24 +- .../Net/Exceptions/SocketReadException.php | 24 +- .../Exceptions/SocketReadTimeoutException.php | 24 +- .../SocketUnreadBufferException.php | 24 +- ...etUnsuppoterdSecureConnectionException.php | 24 +- .../Net/Exceptions/SocketWriteException.php | 24 +- .../MailSo/Pop3/Exceptions/Exception.php | 24 +- .../LoginBadCredentialsException.php | 24 +- .../Exceptions/NegativeResponseException.php | 24 +- .../Pop3/Exceptions/ResponseException.php | 100 +- .../Pop3/Exceptions/RuntimeException.php | 24 +- libraries/MailSo/Pop3/Pop3Client.php | 726 +- .../MailSo/Poppassd/Exceptions/Exception.php | 24 +- .../LoginBadCredentialsException.php | 24 +- .../Exceptions/NegativeResponseException.php | 24 +- .../Poppassd/Exceptions/ResponseException.php | 100 +- .../Poppassd/Exceptions/RuntimeException.php | 24 +- libraries/MailSo/Poppassd/PoppassdClient.php | 572 +- .../MailSo/Sieve/Exceptions/Exception.php | 24 +- .../LoginBadCredentialsException.php | 24 +- .../Exceptions/LoginBadMethodException.php | 22 +- .../Sieve/Exceptions/LoginException.php | 24 +- .../Exceptions/NegativeResponseException.php | 24 +- .../Sieve/Exceptions/ResponseException.php | 100 +- .../Sieve/Exceptions/RuntimeException.php | 24 +- libraries/MailSo/Sieve/ManageSieveClient.php | 1254 +-- .../MailSo/Smtp/Exceptions/Exception.php | 24 +- .../LoginBadCredentialsException.php | 24 +- .../Exceptions/LoginBadMethodException.php | 24 +- .../MailSo/Smtp/Exceptions/LoginException.php | 24 +- .../Exceptions/NegativeResponseException.php | 24 +- .../Smtp/Exceptions/ResponseException.php | 100 +- .../Smtp/Exceptions/RuntimeException.php | 24 +- libraries/MailSo/Smtp/SmtpClient.php | 1530 +-- libraries/MailSo/Vendors/Net/IDNA2.php | 6808 ++++++------- .../MailSo/Vendors/Net/IDNA2/Exception.php | 10 +- .../Vendors/Net/IDNA2/Exception/Nameprep.php | 20 +- .../Vendors/Net/IDNA2CustomExceptions.php | 18 +- libraries/MailSo/Version.php | 104 +- .../OAuthClient/database_oauth_client.php | 548 +- libraries/OAuthClient/http.php | 4252 ++++---- libraries/OAuthClient/login_with_facebook.php | 262 +- libraries/OAuthClient/mysqli_oauth_client.php | 284 +- libraries/OAuthClient/oauth.sql | 36 +- libraries/OAuthClient/oauth_client.php | 5720 +++++------ libraries/OAuthClient/oauth_client_class.html | 1664 +-- .../OAuthClient/oauth_configuration.json | 822 +- libraries/PHPGangsta/GoogleAuthenticator.php | 410 +- libraries/PHPThumb/GD.php | 2834 +++--- libraries/PHPThumb/PHPThumb.php | 298 +- libraries/PHPThumb/PluginInterface.php | 24 +- libraries/PHPThumb/Plugins/Reflection.php | 522 +- libraries/ProjectCore/Actions.php | 67 +- libraries/ProjectCore/ActionsBase.php | 12 +- libraries/ProjectCore/Notifications.php | 1 + libraries/ProjectCore/Service.php | 74 +- .../Sabre/CalDAV/Backend/AbstractBackend.php | 310 +- .../Sabre/CalDAV/Backend/BackendInterface.php | 466 +- .../CalDAV/Backend/NotificationSupport.php | 94 +- libraries/Sabre/CalDAV/Backend/PDO.php | 1382 +-- .../Sabre/CalDAV/Backend/SharingSupport.php | 486 +- libraries/Sabre/CalDAV/Calendar.php | 752 +- libraries/Sabre/CalDAV/CalendarObject.php | 558 +- .../Sabre/CalDAV/CalendarQueryParser.php | 596 +- .../Sabre/CalDAV/CalendarQueryValidator.php | 784 +- libraries/Sabre/CalDAV/CalendarRootNode.php | 154 +- .../CalDAV/Exception/InvalidComponentType.php | 70 +- libraries/Sabre/CalDAV/ICSExportPlugin.php | 284 +- libraries/Sabre/CalDAV/ICalendar.php | 72 +- libraries/Sabre/CalDAV/ICalendarObject.php | 42 +- libraries/Sabre/CalDAV/IShareableCalendar.php | 96 +- libraries/Sabre/CalDAV/ISharedCalendar.php | 72 +- .../Sabre/CalDAV/Notifications/Collection.php | 346 +- .../CalDAV/Notifications/ICollection.php | 48 +- .../Sabre/CalDAV/Notifications/INode.php | 76 +- .../Notifications/INotificationType.php | 88 +- libraries/Sabre/CalDAV/Notifications/Node.php | 384 +- .../Notifications/Notification/Invite.php | 648 +- .../Notification/InviteReply.php | 436 +- .../Notification/SystemStatus.php | 364 +- libraries/Sabre/CalDAV/Plugin.php | 2676 ++--- .../Sabre/CalDAV/Principal/Collection.php | 64 +- .../Sabre/CalDAV/Principal/IProxyRead.php | 38 +- .../Sabre/CalDAV/Principal/IProxyWrite.php | 38 +- .../Sabre/CalDAV/Principal/ProxyRead.php | 360 +- .../Sabre/CalDAV/Principal/ProxyWrite.php | 360 +- libraries/Sabre/CalDAV/Principal/User.php | 268 +- .../CalDAV/Property/AllowedSharingModes.php | 148 +- libraries/Sabre/CalDAV/Property/Invite.php | 454 +- .../Property/ScheduleCalendarTransp.php | 204 +- .../SupportedCalendarComponentSet.php | 176 +- .../CalDAV/Property/SupportedCalendarData.php | 80 +- .../CalDAV/Property/SupportedCollationSet.php | 90 +- libraries/Sabre/CalDAV/Schedule/IMip.php | 222 +- libraries/Sabre/CalDAV/Schedule/IOutbox.php | 32 +- libraries/Sabre/CalDAV/Schedule/Outbox.php | 326 +- libraries/Sabre/CalDAV/ShareableCalendar.php | 144 +- libraries/Sabre/CalDAV/SharedCalendar.php | 232 +- libraries/Sabre/CalDAV/SharingPlugin.php | 1052 +- libraries/Sabre/CalDAV/UserCalendars.php | 684 +- libraries/Sabre/CalDAV/Version.php | 48 +- libraries/Sabre/CardDAV/AddressBook.php | 630 +- .../Sabre/CardDAV/AddressBookQueryParser.php | 442 +- libraries/Sabre/CardDAV/AddressBookRoot.php | 160 +- .../Sabre/CardDAV/Backend/AbstractBackend.php | 36 +- .../CardDAV/Backend/BackendInterface.php | 332 +- libraries/Sabre/CardDAV/Backend/PDO.php | 666 +- libraries/Sabre/CardDAV/Card.php | 520 +- libraries/Sabre/CardDAV/IAddressBook.php | 40 +- libraries/Sabre/CardDAV/ICard.php | 40 +- libraries/Sabre/CardDAV/IDirectory.php | 42 +- libraries/Sabre/CardDAV/Plugin.php | 1412 +-- .../CardDAV/Property/SupportedAddressData.php | 144 +- libraries/Sabre/CardDAV/UserAddressBooks.php | 520 +- libraries/Sabre/CardDAV/VCFExportPlugin.php | 216 +- libraries/Sabre/CardDAV/Version.php | 52 +- .../Sabre/DAV/Auth/Backend/AbstractBasic.php | 174 +- .../Sabre/DAV/Auth/Backend/AbstractDigest.php | 202 +- libraries/Sabre/DAV/Auth/Backend/Apache.php | 126 +- .../DAV/Auth/Backend/BackendInterface.php | 72 +- libraries/Sabre/DAV/Auth/Backend/File.php | 154 +- libraries/Sabre/DAV/Auth/Backend/PDO.php | 130 +- libraries/Sabre/DAV/Auth/Plugin.php | 224 +- .../Sabre/DAV/Browser/GuessContentType.php | 198 +- .../Sabre/DAV/Browser/MapGetToPropFind.php | 114 +- libraries/Sabre/DAV/Browser/Plugin.php | 982 +- libraries/Sabre/DAV/Client.php | 1150 +-- libraries/Sabre/DAV/Collection.php | 220 +- libraries/Sabre/DAV/Exception.php | 128 +- libraries/Sabre/DAV/Exception/BadRequest.php | 56 +- libraries/Sabre/DAV/Exception/Conflict.php | 56 +- .../Sabre/DAV/Exception/ConflictingLock.php | 74 +- .../Sabre/DAV/Exception/FileNotFound.php | 38 +- libraries/Sabre/DAV/Exception/Forbidden.php | 54 +- .../DAV/Exception/InsufficientStorage.php | 54 +- .../DAV/Exception/InvalidResourceType.php | 66 +- .../Sabre/DAV/Exception/LengthRequired.php | 60 +- .../Exception/LockTokenMatchesRequestUri.php | 82 +- libraries/Sabre/DAV/Exception/Locked.php | 146 +- .../Sabre/DAV/Exception/MethodNotAllowed.php | 90 +- .../Sabre/DAV/Exception/NotAuthenticated.php | 60 +- libraries/Sabre/DAV/Exception/NotFound.php | 56 +- .../Sabre/DAV/Exception/NotImplemented.php | 54 +- .../Sabre/DAV/Exception/PaymentRequired.php | 60 +- .../DAV/Exception/PreconditionFailed.php | 142 +- .../DAV/Exception/ReportNotSupported.php | 64 +- .../RequestedRangeNotSatisfiable.php | 62 +- .../DAV/Exception/ServiceUnavailable.php | 60 +- .../DAV/Exception/UnsupportedMediaType.php | 56 +- libraries/Sabre/DAV/FS/Directory.php | 280 +- libraries/Sabre/DAV/FS/File.php | 182 +- libraries/Sabre/DAV/FS/Node.php | 164 +- libraries/Sabre/DAV/FSExt/File.php | 292 +- libraries/Sabre/DAV/FSExt/Node.php | 428 +- libraries/Sabre/DAV/File.php | 170 +- libraries/Sabre/DAV/ICollection.php | 154 +- libraries/Sabre/DAV/IExtendedCollection.php | 56 +- libraries/Sabre/DAV/IFile.php | 154 +- libraries/Sabre/DAV/INode.php | 92 +- libraries/Sabre/DAV/IProperties.php | 142 +- libraries/Sabre/DAV/IQuota.php | 54 +- .../DAV/Locks/Backend/AbstractBackend.php | 42 +- .../DAV/Locks/Backend/BackendInterface.php | 102 +- libraries/Sabre/DAV/Locks/Backend/FS.php | 386 +- libraries/Sabre/DAV/Locks/Backend/File.php | 366 +- libraries/Sabre/DAV/Locks/Backend/PDO.php | 334 +- libraries/Sabre/DAV/Locks/LockInfo.php | 162 +- libraries/Sabre/DAV/Locks/Plugin.php | 1298 +-- libraries/Sabre/DAV/Mount/Plugin.php | 166 +- libraries/Sabre/DAV/Node.php | 110 +- libraries/Sabre/DAV/ObjectTree.php | 318 +- libraries/Sabre/DAV/PartialUpdate/IFile.php | 78 +- .../Sabre/DAV/PartialUpdate/IPatchSupport.php | 96 +- libraries/Sabre/DAV/PartialUpdate/Plugin.php | 492 +- libraries/Sabre/DAV/Property.php | 62 +- .../Sabre/DAV/Property/GetLastModified.php | 156 +- libraries/Sabre/DAV/Property/Href.php | 198 +- libraries/Sabre/DAV/Property/HrefList.php | 210 +- libraries/Sabre/DAV/Property/IHref.php | 50 +- .../Sabre/DAV/Property/LockDiscovery.php | 208 +- libraries/Sabre/DAV/Property/ResourceType.php | 254 +- libraries/Sabre/DAV/Property/Response.php | 314 +- libraries/Sabre/DAV/Property/ResponseList.php | 118 +- .../Sabre/DAV/Property/SupportedLock.php | 156 +- .../Sabre/DAV/Property/SupportedReportSet.php | 222 +- libraries/Sabre/DAV/PropertyInterface.php | 42 +- libraries/Sabre/DAV/Server.php | 4356 ++++---- libraries/Sabre/DAV/ServerPlugin.php | 180 +- libraries/Sabre/DAV/SimpleCollection.php | 216 +- libraries/Sabre/DAV/SimpleFile.php | 242 +- libraries/Sabre/DAV/StringUtil.php | 182 +- .../Sabre/DAV/TemporaryFileFilterPlugin.php | 578 +- libraries/Sabre/DAV/Tree.php | 386 +- libraries/Sabre/DAV/Tree/Filesystem.php | 266 +- libraries/Sabre/DAV/URLUtil.php | 248 +- libraries/Sabre/DAV/UUIDUtil.php | 128 +- libraries/Sabre/DAV/Version.php | 48 +- libraries/Sabre/DAV/XMLUtil.php | 382 +- .../DAVACL/AbstractPrincipalCollection.php | 310 +- .../Sabre/DAVACL/Exception/AceConflict.php | 70 +- .../Sabre/DAVACL/Exception/NeedPrivileges.php | 166 +- .../Sabre/DAVACL/Exception/NoAbstract.php | 70 +- .../Exception/NotRecognizedPrincipal.php | 70 +- .../Exception/NotSupportedPrivilege.php | 70 +- libraries/Sabre/DAVACL/IACL.php | 148 +- libraries/Sabre/DAVACL/IPrincipal.php | 154 +- .../Sabre/DAVACL/IPrincipalCollection.php | 84 +- libraries/Sabre/DAVACL/Plugin.php | 2804 +++--- libraries/Sabre/DAVACL/Principal.php | 562 +- .../PrincipalBackend/AbstractBackend.php | 36 +- .../PrincipalBackend/BackendInterface.php | 306 +- .../Sabre/DAVACL/PrincipalBackend/PDO.php | 856 +- .../Sabre/DAVACL/PrincipalCollection.php | 66 +- libraries/Sabre/DAVACL/Property/Acl.php | 422 +- .../Sabre/DAVACL/Property/AclRestrictions.php | 68 +- .../Property/CurrentUserPrivilegeSet.php | 248 +- libraries/Sabre/DAVACL/Property/Principal.php | 322 +- .../DAVACL/Property/SupportedPrivilegeSet.php | 188 +- libraries/Sabre/DAVACL/Version.php | 48 +- libraries/Sabre/HTTP/AWSAuth.php | 454 +- libraries/Sabre/HTTP/AbstractAuth.php | 222 +- libraries/Sabre/HTTP/BasicAuth.php | 134 +- libraries/Sabre/HTTP/DigestAuth.php | 480 +- libraries/Sabre/HTTP/Request.php | 568 +- libraries/Sabre/HTTP/Response.php | 350 +- libraries/Sabre/HTTP/Util.php | 164 +- libraries/Sabre/HTTP/Version.php | 48 +- libraries/Sabre/autoload.php | 50 +- libraries/Services/Twilio.php | 626 +- .../Services/Twilio/AutoPagingIterator.php | 218 +- libraries/Services/Twilio/Capability.php | 692 +- libraries/Services/Twilio/HttpException.php | 4 +- libraries/Services/Twilio/HttpStream.php | 188 +- .../Services/Twilio/InstanceResource.php | 168 +- libraries/Services/Twilio/ListResource.php | 406 +- libraries/Services/Twilio/NumberType.php | 70 +- libraries/Services/Twilio/Page.php | 136 +- .../Twilio/PartialApplicationHelper.php | 82 +- .../Services/Twilio/RequestValidator.php | 72 +- libraries/Services/Twilio/Resource.php | 268 +- libraries/Services/Twilio/Rest/Account.php | 66 +- libraries/Services/Twilio/Rest/Accounts.php | 50 +- .../Services/Twilio/Rest/Application.php | 12 +- .../Services/Twilio/Rest/Applications.php | 24 +- .../Twilio/Rest/AuthorizedConnectApp.php | 12 +- .../Twilio/Rest/AuthorizedConnectApps.php | 20 +- .../Twilio/Rest/AvailablePhoneNumber.php | 14 +- .../Twilio/Rest/AvailablePhoneNumbers.php | 108 +- libraries/Services/Twilio/Rest/Call.php | 210 +- libraries/Services/Twilio/Rest/Calls.php | 54 +- libraries/Services/Twilio/Rest/Conference.php | 24 +- .../Services/Twilio/Rest/Conferences.php | 12 +- libraries/Services/Twilio/Rest/ConnectApp.php | 12 +- .../Services/Twilio/Rest/ConnectApps.php | 20 +- libraries/Services/Twilio/Rest/Credential.php | 60 +- .../Services/Twilio/Rest/CredentialList.php | 84 +- .../Twilio/Rest/CredentialListMapping.php | 74 +- .../Twilio/Rest/CredentialListMappings.php | 48 +- .../Services/Twilio/Rest/CredentialLists.php | 48 +- .../Services/Twilio/Rest/Credentials.php | 56 +- libraries/Services/Twilio/Rest/Domain.php | 140 +- libraries/Services/Twilio/Rest/Domains.php | 56 +- .../Twilio/Rest/IncomingPhoneNumber.php | 182 +- .../Twilio/Rest/IncomingPhoneNumbers.php | 118 +- .../Twilio/Rest/IpAccessControlList.php | 80 +- .../Rest/IpAccessControlListMapping.php | 74 +- .../Rest/IpAccessControlListMappings.php | 50 +- .../Twilio/Rest/IpAccessControlLists.php | 54 +- libraries/Services/Twilio/Rest/IpAddress.php | 68 +- .../Services/Twilio/Rest/IpAddresses.php | 66 +- libraries/Services/Twilio/Rest/Media.php | 62 +- .../Services/Twilio/Rest/MediaInstance.php | 74 +- libraries/Services/Twilio/Rest/Member.php | 44 +- libraries/Services/Twilio/Rest/Members.php | 56 +- libraries/Services/Twilio/Rest/Message.php | 106 +- libraries/Services/Twilio/Rest/Messages.php | 146 +- .../Services/Twilio/Rest/Notification.php | 12 +- .../Services/Twilio/Rest/Notifications.php | 12 +- .../Services/Twilio/Rest/OutgoingCallerId.php | 12 +- .../Twilio/Rest/OutgoingCallerIds.php | 24 +- .../Services/Twilio/Rest/Participant.php | 20 +- .../Services/Twilio/Rest/Participants.php | 20 +- libraries/Services/Twilio/Rest/Queue.php | 20 +- libraries/Services/Twilio/Rest/Queues.php | 38 +- libraries/Services/Twilio/Rest/Recording.php | 18 +- libraries/Services/Twilio/Rest/Recordings.php | 12 +- libraries/Services/Twilio/Rest/Sandbox.php | 12 +- libraries/Services/Twilio/Rest/ShortCode.php | 12 +- libraries/Services/Twilio/Rest/ShortCodes.php | 20 +- libraries/Services/Twilio/Rest/Sip.php | 38 +- libraries/Services/Twilio/Rest/SmsMessage.php | 12 +- .../Services/Twilio/Rest/SmsMessages.php | 36 +- .../Services/Twilio/Rest/Transcription.php | 12 +- .../Services/Twilio/Rest/Transcriptions.php | 12 +- .../Services/Twilio/Rest/UsageRecord.php | 12 +- .../Services/Twilio/Rest/UsageRecords.php | 66 +- .../Services/Twilio/Rest/UsageTrigger.php | 10 +- .../Services/Twilio/Rest/UsageTriggers.php | 54 +- libraries/Services/Twilio/RestException.php | 88 +- libraries/Services/Twilio/SIPListResource.php | 28 +- .../Services/Twilio/TimeRangeResource.php | 62 +- libraries/Services/Twilio/TinyHttp.php | 252 +- libraries/Services/Twilio/Twiml.php | 274 +- libraries/Services/Twilio/UsageResource.php | 40 +- libraries/Services/cacert.pem | 7698 +++++++------- .../Exception/ExceptionInterface.php | 46 +- .../Exception/FileNotFoundException.php | 68 +- .../Filesystem/Exception/IOException.php | 82 +- .../Exception/IOExceptionInterface.php | 54 +- .../Component/Filesystem/Filesystem.php | 948 +- .../DAV/CalDAV/CalendarRootNode.php | 50 +- .../DAV/CardDAV/EmptyAddressBooks.php | 40 +- libraries/afterlogic/DAV/CardDAV/GCard.php | 164 +- .../DAV/CardDAV/SharedAddressBook.php | 334 +- .../afterlogic/DAV/CardDAV/SharedCard.php | 82 +- libraries/afterlogic/DAV/FS/File.php | 108 +- libraries/afterlogic/DAV/FS/RootPersonal.php | 114 +- libraries/afterlogic/DAV/FS/RootPublic.php | 136 +- libraries/afterlogic/DAV/FS/RootShared.php | 148 +- .../afterlogic/DAV/FS/SharedDirectory.php | 302 +- libraries/afterlogic/DAV/FS/SharedFile.php | 204 +- libraries/afterlogic/DAV/Logs/Plugin.php | 144 +- .../afterlogic/DAV/Principal/Backend/PDO.php | 144 +- libraries/afterlogic/DAV/Reminders/Plugin.php | 280 +- libraries/afterlogic/DAV/autoload.php | 34 +- libraries/afterlogic/api.php | 2293 ++--- libraries/afterlogic/common/config.php | 545 +- libraries/afterlogic/common/container.php | 1268 +-- libraries/afterlogic/common/db/helper.php | 84 +- .../afterlogic/common/db/mysql/helper.php | 378 +- .../afterlogic/common/db/pdo/mysql_helper.php | 442 +- .../common/db/pdo/postgres_helper.php | 470 +- libraries/afterlogic/common/db/table.php | 1018 +- libraries/afterlogic/common/enum.php | 1834 ++-- libraries/afterlogic/common/exception.php | 770 +- libraries/afterlogic/common/i18n/en.ini | 7 +- libraries/afterlogic/common/i18n/ru.ini | 88 +- .../common/managers/capability/manager.php | 2 +- .../managers/contactsmain/classes/contact.php | 1220 +-- .../common/managers/contactsmain/manager.php | 2422 ++--- .../contactsmain/storages/db/storage.php | 1984 ++-- .../common/managers/db/classes/enum.php | 32 +- .../filestorage/storages/sabredav/storage.php | 19 + .../common/managers/helpdesk/classes/enum.php | 102 +- .../common/managers/helpdesk/manager.php | 4 - .../common/managers/integrator/manager.php | 4264 ++++---- .../common/managers/mail/classes/enum.php | 82 +- .../common/managers/mail/classes/ics.php | 226 +- .../common/managers/mail/manager.php | 6450 ++++++------ .../common/managers/sieve/classes/enum.php | 88 +- .../common/managers/social/classes/social.php | 342 +- .../common/managers/social/manager.php | 440 +- .../social/storages/db/command_creator.php | 332 +- .../managers/social/storages/db/storage.php | 386 +- .../managers/social/storages/default.php | 212 +- .../managers/tenants/classes/socials.php | 284 +- .../managers/tenants/classes/tenant.php | 968 +- .../common/managers/tenants/manager.php | 1660 +-- .../common/managers/users/classes/account.php | 958 +- .../common/managers/users/classes/enum.php | 184 +- .../common/managers/users/classes/user.php | 824 +- .../common/managers/users/manager.php | 3180 +++--- .../users/storages/db/command_creator.php | 2146 ++-- .../managers/users/storages/db/storage.php | 2080 ++-- libraries/afterlogic/common/net/abstract.php | 354 +- .../afterlogic/common/net/protocols/imap4.php | 530 +- .../afterlogic/common/net/protocols/pop3.php | 240 +- .../common/net/protocols/poppassd.php | 262 +- libraries/afterlogic/common/plugin.php | 2158 ++-- .../common/plugins/expand-attachment.php | 124 +- libraries/afterlogic/common/settings.php | 1374 +-- libraries/afterlogic/common/utils.php | 4592 ++++----- libraries/autoload.php | 16 +- libraries/composer/ClassLoader.php | 414 +- libraries/composer/autoload_classmap.php | 18 +- libraries/composer/autoload_namespaces.php | 30 +- libraries/composer/autoload_real.php | 70 +- libraries/composer/installed.json | 100 +- libraries/other/CssToInlineStyles.php | 1430 +-- libraries/other/Zip.php | 1690 ++-- libraries/other/ZipStream.php | 1422 +-- libraries/recaptcha/LICENSE | 44 +- libraries/recaptcha/README | 2 +- libraries/recaptcha/recaptchalib.php | 552 +- migration/calendar-sharing.php | 64 +- rest.php | 1712 ++-- skins/Blue/PIE/PIE.htc | 42 +- skins/Blue/PIE/PIE.php | 36 +- skins/Blue/PIE/PIE_IE678.js | 144 +- skins/Blue/PIE/PIE_IE678_uncompressed.js | 8900 ++++++++--------- skins/Blue/PIE/PIE_IE9.js | 92 +- skins/Blue/PIE/PIE_IE9_uncompressed.js | 5982 +++++------ skins/Blue/PIE/PIE_uncompressed.htc | 254 +- skins/Blue/fonts/afterlogic.svg | 258 +- skins/Blue/images/filters.svg | 38 +- skins/Blue/less/styles-mobile.less | 92 +- skins/Blue/less/styles.less | 84 +- skins/Blue/less/text-fade.less | 30 +- skins/Blue/sharing.css | 302 +- skins/Blue/styles-mobile.css | 18 +- skins/Blue/styles.css | 205 +- skins/BlueJeans/PIE/PIE.htc | 42 +- skins/BlueJeans/PIE/PIE.php | 36 +- skins/BlueJeans/PIE/PIE_IE678.js | 144 +- skins/BlueJeans/PIE/PIE_IE678_uncompressed.js | 8900 ++++++++--------- skins/BlueJeans/PIE/PIE_IE9.js | 92 +- skins/BlueJeans/PIE/PIE_IE9_uncompressed.js | 5982 +++++------ skins/BlueJeans/PIE/PIE_uncompressed.htc | 254 +- skins/BlueJeans/fonts/afterlogic.svg | 258 +- skins/BlueJeans/less/styles-mobile.less | 92 +- skins/BlueJeans/less/styles.less | 84 +- skins/BlueJeans/less/text-fade.less | 30 +- skins/BlueJeans/sharing.css | 4 +- skins/BlueJeans/styles-mobile.css | 18 +- skins/BlueJeans/styles.css | 213 +- skins/DeepForest/PIE/PIE.htc | 42 +- skins/DeepForest/PIE/PIE.php | 36 +- skins/DeepForest/PIE/PIE_IE678.js | 144 +- .../DeepForest/PIE/PIE_IE678_uncompressed.js | 8900 ++++++++--------- skins/DeepForest/PIE/PIE_IE9.js | 92 +- skins/DeepForest/PIE/PIE_IE9_uncompressed.js | 5982 +++++------ skins/DeepForest/PIE/PIE_uncompressed.htc | 254 +- skins/DeepForest/fonts/afterlogic.svg | 258 +- skins/DeepForest/less/styles-mobile.less | 92 +- skins/DeepForest/less/styles.less | 84 +- skins/DeepForest/less/text-fade.less | 30 +- skins/DeepForest/sharing.css | 4 +- skins/DeepForest/styles-mobile.css | 18 +- skins/DeepForest/styles.css | 213 +- skins/Default/PIE/PIE.htc | 42 +- skins/Default/PIE/PIE.php | 36 +- skins/Default/PIE/PIE_IE678.js | 144 +- skins/Default/PIE/PIE_IE678_uncompressed.js | 8900 ++++++++--------- skins/Default/PIE/PIE_IE9.js | 92 +- skins/Default/PIE/PIE_IE9_uncompressed.js | 5982 +++++------ skins/Default/PIE/PIE_uncompressed.htc | 254 +- skins/Default/fonts/afterlogic.svg | 258 +- skins/Default/less/base-mobile.less | 614 +- skins/Default/less/base.less | 772 +- skins/Default/less/blockquote.less | 70 +- skins/Default/less/contact-card.less | 170 +- skins/Default/less/controls/buttons.less | 248 +- .../less/controls/jquery-ui-overrides.less | 150 +- skins/Default/less/files.less | 412 +- skins/Default/less/folders.less | 68 +- skins/Default/less/fonts.less | 60 +- skins/Default/less/grid.less | 1946 ++-- skins/Default/less/keyframes.less | 330 +- skins/Default/less/notifications.less | 248 +- skins/Default/less/phone-block.less | 676 +- skins/Default/less/screens.less | 14 +- skins/Default/less/screens/calendar.less | 3 +- skins/Default/less/screens/compose.less | 4 +- skins/Default/less/screens/mail-mobile.less | 1536 +-- skins/Default/less/screens/mail.less | 1428 +-- skins/Default/less/search-block.less | 546 +- skins/Default/less/styles-mobile.less | 102 +- skins/Default/less/tabsbar-mobile.less | 302 +- skins/Default/less/text-fade.less | 150 +- skins/Default/less/tmp.less | 141 +- skins/Default/less/volumer.less | 50 +- skins/Default/sharing.css | 4 +- skins/Default/styles-mobile.css | 18 +- skins/Default/styles.css | 101 +- skins/Funny/PIE/PIE.htc | 42 +- skins/Funny/PIE/PIE.php | 36 +- skins/Funny/PIE/PIE_IE678.js | 144 +- skins/Funny/PIE/PIE_IE678_uncompressed.js | 8900 ++++++++--------- skins/Funny/PIE/PIE_IE9.js | 92 +- skins/Funny/PIE/PIE_IE9_uncompressed.js | 5982 +++++------ skins/Funny/PIE/PIE_uncompressed.htc | 254 +- skins/Funny/fonts/afterlogic.svg | 258 +- skins/Funny/less/styles-mobile.less | 92 +- skins/Funny/less/styles.less | 84 +- skins/Funny/less/text-fade.less | 30 +- skins/Funny/sharing.css | 4 +- skins/Funny/styles-mobile.css | 98 +- skins/Funny/styles.css | 205 +- skins/OpenWater/PIE/PIE.htc | 42 +- skins/OpenWater/PIE/PIE.php | 36 +- skins/OpenWater/PIE/PIE_IE678.js | 144 +- skins/OpenWater/PIE/PIE_IE678_uncompressed.js | 8900 ++++++++--------- skins/OpenWater/PIE/PIE_IE9.js | 92 +- skins/OpenWater/PIE/PIE_IE9_uncompressed.js | 5982 +++++------ skins/OpenWater/PIE/PIE_uncompressed.htc | 254 +- skins/OpenWater/fonts/afterlogic.svg | 258 +- skins/OpenWater/less/styles-mobile.less | 92 +- skins/OpenWater/less/styles.less | 84 +- skins/OpenWater/less/text-fade.less | 30 +- skins/OpenWater/sharing.css | 4 +- skins/OpenWater/styles-mobile.css | 18 +- skins/OpenWater/styles.css | 213 +- skins/White/PIE/PIE.htc | 42 +- skins/White/PIE/PIE.php | 36 +- skins/White/PIE/PIE_IE678.js | 144 +- skins/White/PIE/PIE_IE678_uncompressed.js | 8900 ++++++++--------- skins/White/PIE/PIE_IE9.js | 92 +- skins/White/PIE/PIE_IE9_uncompressed.js | 5982 +++++------ skins/White/PIE/PIE_uncompressed.htc | 254 +- skins/White/fonts/afterlogic.svg | 258 +- skins/White/less/styles-mobile.less | 92 +- skins/White/less/styles.less | 84 +- skins/White/sharing.css | 4 +- skins/White/styles-mobile.css | 18 +- skins/White/styles.css | 101 +- static/css/libs.css | 1228 +-- static/css/libs.min.css | 16 +- static/js/app-mobile.js | 129 +- static/js/app-mobile.min.js | 28 +- static/js/app.js | 156 +- static/js/app.min.js | 38 +- static/js/extutils.min.js | 7 - static/js/libs.js | 5 +- templates/CalendarEventInvite.html | 4 +- templates/FilesPub.html | 52 +- .../CalendarReminderPartReminders.html | 22 +- .../Calendar/CalendarReminderPartText.html | 2 +- templates/views/CalendarPubLayout.html | 44 +- .../views/Common/ColorPickerViewModel.html | 30 +- templates/views/Common/ContactCard.html | 340 +- .../views/Common/HtmlEditorViewModel.html | 2 + .../views/Common/InformationViewModel.html | 42 +- .../views/Common/PageSwitcherViewModel.html | 16 +- .../views/Contacts/ContactsViewModel.html | 116 +- templates/views/Contacts/Toolbar.html | 156 +- .../FileStorage/FileStorageViewModel.html | 58 +- templates/views/FileStorage/FolderItem.html | 54 +- templates/views/FileStoragePubLayout.html | 40 +- templates/views/Helpdesk/Header.html | 20 +- .../views/Helpdesk/HelpdeskViewModel.html | 62 +- templates/views/Helpdesk/Login.html | 400 +- templates/views/Helpdesk/SettingsExt.html | 110 +- templates/views/Helpdesk/ThreadItem.html | 44 +- templates/views/Helpdesk/ThreadItemExt.html | 46 +- .../views/Helpdesk/ViewThreadInNewWindow.html | 16 +- .../views/Mail/AppointmentViewModel.html | 96 +- templates/views/Mail/ComposeViewModel.html | 4 +- templates/views/Mail/FolderViewModel.html | 74 +- .../Mail/LayoutSidePane/MailViewModel.html | 70 +- .../LayoutSidePane/MessagePaneViewModel.html | 3 + .../views/Mail/MessageListItemViewModel.html | 96 +- templates/views/Mail/MoveToFolderItem.html | 32 +- .../views/Mail/PrintMessageViewModel.html | 236 +- .../Popups/AccountCreatePopupViewModel.html | 124 +- .../Calendar/CalendarPopupViewModel.html | 50 +- .../EditRecurrenceEventPopupViewModel.html | 20 +- .../Popups/Calendar/EventPopupViewModel.html | 562 +- .../Calendar/GetLinkPopupViewModel.html | 70 +- .../Popups/Calendar/SharePopupViewModel.html | 134 +- .../views/Popups/ConfirmPopupViewModel.html | 20 +- .../Popups/ContactCreatePopupViewModel.html | 98 +- .../Popups/FetcherAddPopupViewModel.html | 108 +- .../FileStoragePopupViewModel.html | 44 +- .../FolderCreatePopupViewModel.html | 38 +- .../FileStorage/LinkCreatePopupViewModel.html | 50 +- .../FileStorage/RenamePopupViewModel.html | 40 +- .../FileStorage/SharePopupViewModel.html | 36 +- .../Popups/FolderCreatePopupViewModel.html | 48 +- .../Popups/FolderSystemPopupViewModel.html | 74 +- .../views/Popups/PlayerPopupViewModel.html | 8 +- .../Settings/AccountFilterPartAction.html | 22 +- .../Settings/AccountFilterPartCondition.html | 24 +- .../Settings/AccountFilterPartField.html | 24 +- .../Settings/AccountFilterPartFolder.html | 26 +- .../views/Settings/AccountFolderItem.html | 50 +- .../AccountFolderItemMovedWithMouse.html | 42 +- .../Settings/IdentityPropertiesViewModel.html | 82 +- .../views/Settings/SettingsViewModel.html | 54 +- 716 files changed, 158481 insertions(+), 158078 deletions(-) create mode 100644 data/plugins/external-services/i18n/Estonian.ini create mode 100644 data/plugins/two-factor-authentication/i18n/Estonian.ini delete mode 100644 favicon-single-compose.ico delete mode 100644 static/js/extutils.min.js diff --git a/LICENSE b/LICENSE index 9a5e16f7..2def0e88 100644 --- a/LICENSE +++ b/LICENSE @@ -1,661 +1,661 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see . \ No newline at end of file diff --git a/VERSION b/VERSION index 56d17257..62a991be 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.6.7 \ No newline at end of file +7.6.8 \ No newline at end of file diff --git a/adminpanel/VERSION b/adminpanel/VERSION index 56d17257..62a991be 100644 --- a/adminpanel/VERSION +++ b/adminpanel/VERSION @@ -1 +1 @@ -7.6.7 \ No newline at end of file +7.6.8 \ No newline at end of file diff --git a/adminpanel/core/cadminpanel.php b/adminpanel/core/cadminpanel.php index b667038d..617ff6d5 100644 --- a/adminpanel/core/cadminpanel.php +++ b/adminpanel/core/cadminpanel.php @@ -1,1322 +1,1322 @@ -aModules = array(); - $this->bShowScreen = true; - - $this->bIsAuth = false; - $this->PType = false; - $this->XType = false; - $this->LType = false; - $this->RType = false; - $this->AType = false; - - $this->sHelpUrl = ''; - - $this->iAuthType = null; - $this->aAuthDomains = null; - $this->iTenantId = 0; - - $this->bSessionIsStarted = false; - - $this->aCssFiles = array(); - $this->aJsFiles = array(); - $this->aJsVars = array(); - $this->aInitJsText = array(); - $this->aTabs = array(); - $this->aModules = array(); - $this->sTab = ''; - $this->sTabsInfo = ''; - - $this->aMainObjectList = array(); - $this->aTabsSort = array(); - - if (null !== $sIndexFileName) - { - $sIndexFileName = basename($sIndexFileName); - if (strlen($sIndexFileName) > 3) - { - define('AP_INDEX_FILE', $sIndexFileName); - } - } - - defined('AP_INDEX_FILE') || define('AP_INDEX_FILE', 'index.php'); - - $this->bSessionIsStarted = self::initInclude(); - - self::initDataPath(); - - $this->initAdminPanel(); - } - - public function Title() - { - echo CApi::I18N('ADMIN_PANEL/TITLE'); - } - - public function End() - { - return $this; - } - - public function Run() - { - @ob_start(); - if ($this->bShowScreen) - { - include self::RootPath().'core/templates/main.php'; - } - return $this; - } - - /** - * @return void - */ - protected function resortTabs() - { - $bResult = $aTemp = array(); - foreach ($this->aTabs as $aTab) - { - $aTemp[$aTab[1]] = $aTab; - } - - foreach ($this->aTabsSort as $sTab) - { - if (in_array($sTab, array_keys($aTemp))) - { - $bResult[] = $aTemp[$sTab]; - } - } - - $this->aTabs = $bResult; - } - - /** - * @return object - */ - protected function initScreen($sTab) - { - $oScreen = null; - if ($this->IsAuth()) - { - $aScreenMap = array( - AP_TAB_COMMON => 'ap_Standard_Screen', - AP_TAB_DOMAINS => 'ap_Table_Screen', - AP_TAB_USERS => 'ap_Table_Screen', - AP_TAB_TENANTS => 'ap_Table_Screen', - AP_TAB_CHANNELS => 'ap_Table_Screen', - AP_TAB_SYSTEM => 'ap_Standard_Screen' - ); - - if (isset($aScreenMap[$sTab])) - { - $oScreen = new $aScreenMap[$sTab]($this); - $oScreen->SetScreenName('screen'.ucfirst($sTab)); - } - - if (empty($_COOKIE['FTE_'])) - { - if (@is_dir(self::GetWebMailPath().'install')) - { - $this->JsAddInitText('OnlineMsgError(\''.CApi::I18N('ADMIN_PANEL/MSG_INSTALLER_FOUND').'\');'); - } - - $oLicApiManager = /* @var $oLicApiManager CApiLicensingManager */ CApi::Manager('licensing'); - if ($oLicApiManager && $oLicApiManager->IsValidKey()) - { - $iType = $oLicApiManager->GetLicenseType(); - $iExpiredSeconds = 0; - if (!$oLicApiManager->IsValidLimit(true)) - { - $this->JsAddInitText('OnlineMsgError(\''.CApi::I18N('ADMIN_PANEL/MSG_LICENSE_USER_LIMIT').'\');'); - } - else if (in_array($iType, array(3, 10)) && $oLicApiManager->IsAboutToExpire($iExpiredSeconds)) - { - $this->JsAddInitText('OnlineMsgError(\''. - sprintf(CApi::I18N('ADMIN_PANEL/MSG_LICENSE_TRIAL_ENDS'), - ceil($iExpiredSeconds / 60 / 60 / 24)). - '\');'); - } - } - - @setcookie('FTE_', true, time() + 600); - } - } - else - { - include_once self::RootPath().'core/screens/login.php'; - $oScreen = new ap_Login_Screen($this); - $oScreen->SetScreenName('screenLogin'); - } - - return $oScreen; - } - - /** - * @return void - */ - public function IncludeScreen() - { - if (!$this->oCurrentScreen) - { - $this->oCurrentScreen = new ap_Simple_Screen($this, 'error.php'); - $this->oCurrentScreen->Data->SetValue('ErrorDesc', 'Admin Panel internal error.'); - } - - if (0 < strlen(CSession::get('SESSION_LOGIN_WARNING', ''))) - { - $this->oCurrentScreen = new ap_Simple_Screen($this, 'login-warning.php'); - $this->oCurrentScreen->Data->SetValue('TxtDesc', CSession::get('SESSION_LOGIN_WARNING', '')); - CSession::Set('SESSION_LOGIN_WARNING', ''); - } - - $this->oCurrentScreen->Run(); - } - - /** - * @return void - */ - public function IncludeCss() - { - foreach ($this->aCssFiles as $sCssFile) - { - echo ''; - } - } - - /** - * @return void - */ - public function IncludeJs() - { - $aLang = include self::RootPath().'core/lang2js.php'; - echo ''; - - echo AP_CRLF; - foreach ($this->aJsFiles as $sJsFile) - { - echo ''; - } - echo ''.AP_CRLF; - } - - /** - * @return void - */ - public function IncludeJsVars() - { - echo ''; - } - - /** - * @param string $sCssFile - */ - public function CssAddFile($sCssFile) - { - $this->aCssFiles[] = $sCssFile; - } - - /** - * @param string $sJsFile - */ - public function JsAddFile($sJsFile) - { - $this->aJsFiles[] = $sJsFile; - } - - /** - * @param string $sName - * @param string $sValue - */ - public function JsAddVar($sName, $sValue) - { - $this->aJsVars[$sName] = $sValue; - } - - /** - * @param string $sJsInitText - */ - public function JsAddInitText($sJsInitText) - { - $this->aInitJsText[] = $sJsInitText; - } - - public function WriteTabs() - { - echo '
'; - - $this->resortTabs(); - - $bIsFirst = true; - foreach ($this->aTabs as $aTab) - { - $sClassToAdd = ''; - if (true === $bIsFirst) - { - $sClassToAdd = ' first'; - $bIsFirst = false; - } - - $sClass = ($this->sTab == $aTab[1]) ? 'wm_tabslist_item wm_active_tab' : 'wm_tabslist_item'; - $sClass .= $sClassToAdd; - - echo ''; - } - - if (0 < strlen($this->sTabsInfo)) - { - echo $this->sTabsInfo; - } - - echo ''; - if (0 < strlen($this->sHelpUrl)) - { - echo ''; - } - echo '
'; - } - - /** - * @param CTenant $oTenant - */ - public function SetTenantTabsInfo($oTenant) - { - $this->sTabsInfo = ''; - if ($oTenant) - { - $this->sTabsInfo = '
'; - $this->sTabsInfo .= CApi::I18N('ADMIN_PANEL/RESOURCES_USAGE').': '.CApi::I18N('ADMIN_PANEL/RESOURCES_USERS').' - '; - $this->sTabsInfo .= $oTenant->getUserCount(); - - if (0 < $oTenant->UserCountLimit) - { - $this->sTabsInfo .= ' '.sprintf(CApi::I18N('ADMIN_PANEL/RESOURCES_USERS_MAX'),$oTenant->UserCountLimit); - } - - $iUsed = 0; - if (0 < $oTenant->QuotaInMB) - { - $iUsed = floor(($oTenant->AllocatedSpaceInMB / $oTenant->QuotaInMB) * 100); - $this->sTabsInfo .='; '.CApi::I18N('ADMIN_PANEL/RESOURCES_DISK').' - '. $iUsed.'% ('.$oTenant->AllocatedSpaceInMB.' MB) '.CApi::I18N('ADMIN_PANEL/RESOURCES_DISK_OF').' '.$oTenant->QuotaInMB.' MB '.CApi::I18N('ADMIN_PANEL/RESOURCES_DISK_ALLOC'); - } - else - { - $this->sTabsInfo .='; '.CApi::I18N('ADMIN_PANEL/RESOURCES_DISK').' - '. $oTenant->AllocatedSpaceInMB.' MB '.CApi::I18N('ADMIN_PANEL/RESOURCES_DISK_ALLOC'); - } - - $this->sTabsInfo .= '
'; - } - } - - /** - * @return string - */ - public function Tab() - { - return $this->sTab; - } - - /** - * @return array - */ - public function &GetTabs() - { - return $this->aTabs; - } - - /** - * @return array - */ - public function RemoveTabs($aTabNames) - { - if (is_array($aTabNames)) - { - $aNewTabs = array(); - $aTabs =& $this->aTabs; - - foreach ($aTabs as $aTabItem) - { - if (!in_array($aTabItem[1], $aTabNames)) - { - $aNewTabs[] = $aTabItem; - } - } - - $this->aTabs = $aNewTabs; - } - } - - /** - * @return void - */ - protected function initAdminPanel() - { - $this->RType = (bool) CApi::GetConf('tenant', false); - $this->AType = !!CApi::Manager('collaboration'); - - $this->aTabsSort = array( - AP_TAB_COMMON, - AP_TAB_DOMAINS, - AP_TAB_USERS, - AP_TAB_TENANTS, - AP_TAB_CHANNELS, - AP_TAB_SYSTEM - ); - - $GLOBALS[AP_START_TIME] = ap_Utils::Microtime(); - $GLOBALS[AP_DB_COUNT] = 0; - - if (isset($_GET['logout'])) - { - CSession::ClearAll(); - CApi::Location(AP_INDEX_FILE.'?login'); - } - - if (isset($_GET['tab']) && strlen($_GET['tab']) > 0) - { - CSession::Set(AP_SESS_TAB, $_GET['tab']); - } - else - { - CSession::Set(AP_SESS_TAB, CSession::get(AP_SESS_TAB, AP_TAB_DEFAULT)); - } - - $this->sTab = CSession::get(AP_SESS_TAB, AP_TAB_DEFAULT); - - try - { - $this->CssAddFile('static/styles/style.css'); - $this->JsAddFile('static/js/common.js'); - $this->JsAddFile('static/js/jquery.js'); - $this->JsAddFile('static/js/knockout-2.3.0.js'); - - if (!CApi::IsValid()) - { - return false; - } - - $this->initModules(); - $this->initType(); - $this->initAuth(); - - $this->sHelpUrl = ''; - $sUrl = $this->IsTenantAuthType() ? - (string) CApi::GetConf('labs.custom-tenant-help-url', '') : - (string) CApi::GetConf('labs.custom-admin-help-url', ''); - - if (0 < strlen($sUrl)) - { - $this->sHelpUrl = $sUrl; - } - else - { - if ($this->AType) - { - $this->sHelpUrl = 'http://www.afterlogic.com/wiki/Aurora_documentation'; - } - else if ($this->PType) - { - $this->sHelpUrl = 'http://www.afterlogic.com/wiki/WebMail_Pro_documentation'; - } - else - { - $this->sHelpUrl = 'http://www.afterlogic.com/wiki/WebMail_Lite_documentation'; - } - } - - if (isset($_GET['help'])) - { - if (0 < strlen($this->sHelpUrl)) - { - CApi::Location($this->sHelpUrl); - } - else - { - CApi::Location('?root'); - } - } - - $bResetToDefault = true; - foreach ($this->aTabs as $aTab) - { - if (isset($aTab[1]) && (string) $aTab[1] === (string) $this->sTab) - { - $bResetToDefault = false; - break; - } - } - - if ($bResetToDefault) - { - $this->sTab = $this->IsTenantAuthType() ? AP_TAB_TENANT_DEFAULT : AP_TAB_DEFAULT; - CSession::Set(AP_SESS_TAB, $this->sTab); - } - - if (isset($_GET['submit']) && isset($_POST) && 0 < count($_POST)) - { - $this->bShowScreen = false; - $sReturnRef = $this->initPostActionModules($this->sTab); - CApi::Location(AP_INDEX_FILE.$sReturnRef); - } - else if (isset($_GET['pop'])) - { - $this->bShowScreen = false; - $this->initPopActionModules($this->sTab); - } - else if (isset($_GET['blank'])) - { - $this->bShowScreen = false; - $this->initBlankActionModules($this->sTab); - } - else if (isset($_GET['ajax'])) - { - $this->bShowScreen = false; - $this->initAjaxActionModules($this->sTab); - } - else - { - $this->oCurrentScreen = $this->initScreen($this->sTab); - if ($this->oCurrentScreen) - { - $this->oCurrentScreen->PreModuleInit(); - $this->initCurrentScreenByModules('first', $this->sTab, $this->oCurrentScreen); - $this->oCurrentScreen->MiddleModuleInit(); - $this->initCurrentScreenByModules('second', $this->sTab, $this->oCurrentScreen); - $this->oCurrentScreen->EndModuleInit(); - $this->initCurrentScreenByModules('third', $this->sTab, $this->oCurrentScreen); - } - - if (CSession::Has(AP_SESS_ERROR)) - { - $this->JsAddInitText('OnlineMsgError("'. - ap_Utils::ReBuildStringToJavaScript( - nl2br(CSession::get(AP_SESS_ERROR, '')), '"').'");'); - - CSession::clear(AP_SESS_ERROR); - } - else if (CSession::Has(AP_SESS_MESSAGE)) - { - $this->JsAddInitText('OnlineMsgInfo("'. - ap_Utils::ReBuildStringToJavaScript( - nl2br(CSession::get(AP_SESS_MESSAGE, '')), '"').'");'); - - CSession::clear(AP_SESS_MESSAGE); - } - } - } - catch (Exception $oExeption) - { - $this->oCurrentScreen = new ap_Simple_Screen($this, 'error.php', array( - 'ErrorDesc' => 'Admin Panel internal error.' - )); - } - } - - /** - * @return void - */ - protected function initAuth() - { - $this->iAuthType = AP_SESS_AUTH_TYPE_NONE; - if ((isset($_GET['login']) || isset($_POST['login'])) && - (CPost::Has('AdmloginInput') || CGet::Has('AdmloginInput')) &&CPost::Has('AdmpasswordInput')) - { - $sAdmloginInput = CPost::get('AdmloginInput'); - if (CGet::Has('AdmloginInput')) - { - $sAdmloginInput = CGet::get('AdmloginInput'); - } - - $sLoginSuffix = CPost::get('LoginSuffix', ''); - if (CGet::Has('LoginSuffix')) - { - $sLoginSuffix = CGet::get('LoginSuffix', ''); - } - - if ($this->CallModuleFunction('CCommonModule', 'AuthLogin', - array($sAdmloginInput.$sLoginSuffix, CPost::get('AdmpasswordInput')))) - { - CApi::Location(AP_INDEX_FILE.'?enter'); - } - else - { - CSession::Destroy(); - CApi::Location(AP_INDEX_FILE.'?auth_error'); - } - - exit(); - } - else - { - if ($this->bSessionIsStarted) - { - $this->CallModuleFunction('CCommonModule', 'AuthCheckSet'); - if ($this->IsTenantAuthType()) - { - $aTabs =& $this->GetTabs(); - $aNewTabs = array(); - - foreach ($aTabs as $aTabValue) - { - if (in_array($aTabValue[0], array(CApi::I18N('ADMIN_PANEL/TABNAME_COMMON'), CApi::I18N('ADMIN_PANEL/TABNAME_DOMAINS'), CApi::I18N('ADMIN_PANEL/TABNAME_USERS')))) - { - $aNewTabs[] = $aTabValue; - } - } - - $aTabs = $aNewTabs; - } - } - else - { - CSession::Destroy(); - CApi::Location(AP_INDEX_FILE.'?sess_error'); - exit(); - } - } - } - - /** - * @return void - */ - protected function initType() - { - $this->CallModuleFunction('CProModule', 'InitAdminPanel', array(&$this)); - $this->CallModuleFunction('CBundleModule', 'InitAdminPanel', array(&$this)); - } - - /** - * @return void - */ - protected function initModules() - { - $aLocalModules = array(); - $this->aModules = array(); - - $sModulePath = self::RootPath().'modules/'; - if (is_dir($sModulePath)) - { - if (false !== ($rDirHandle = opendir($sModulePath))) - { - $bIsMailSuite = (bool) CApi::GetConf('mailsuite', false); - while (false !== ($sFile = readdir($rDirHandle))) - { - if ('.' !== $sFile{0} && @file_exists($sModulePath.$sFile.'/index.php')) - { - if (!$bIsMailSuite && 'bundle' === $sFile) - { - continue; - } - - $bDisabled = false; - $iSortIndex = null; - $sCurrentModule = null; - include $sModulePath.$sFile.'/index.php'; - - if (!$bDisabled && null !== $sCurrentModule && null !== $iSortIndex && class_exists($sCurrentModule)) - { - while (isset($aLocalModules[$iSortIndex])) - { - $iSortIndex++; - } - - $aLocalModules[$iSortIndex] = new $sCurrentModule($this, $sModulePath.$sFile); - } - } - } - - closedir($rDirHandle); - } - } - - ksort($aLocalModules); - - foreach ($aLocalModules as $oModule) - { - $this->aModules[get_class($oModule)] = $oModule; - } - } - - /** - * @param int $iDomainId - * @return bool - */ - public function HasAccessDomain($iDomainId) - { - static $aCache = array(); - $iDomainId = '' === $iDomainId ? 0 : (int) $iDomainId; - - if (isset($aCache[$iDomainId])) - { - return $aCache[$iDomainId]; - } - - $iTenantId = $this->TenantId(); - - $bResult = false; - if (AP_SESS_AUTH_TYPE_SUPER_ADMIN_ONLYREAD === $this->iAuthType) - { - CApi::Plugin()->RunHook('adminpanel-demo-domain-access', array($iDomainId, &$bResult)); - } - else if ((0 < $iDomainId && 0 < $iTenantId) || 0 === $iTenantId) - { - if (0 < $iTenantId) - { - $oDomainsApi = /* @var $oDomainsApi CApiDomainsManager */ CApi::Manager('domains'); - $oDomain = /* @var $oDomain CDomain */$oDomainsApi->getDomainById($iDomainId); - if ($oDomain && $iTenantId === $oDomain->IdTenant) - { - $bResult = true; - } - } - else - { - $bResult = true; - } - } - - $aCache[$iDomainId] = $bResult; - return $bResult; - } - - /** - * @param string $sName - * @return mixed - */ - public function &GetMainObject($sName) - { - $oResult = null; - if ($this->IsMainObjectExist($sName)) - { - $oResult =& $this->aMainObjectList[$sName]; - } - else - { - CApi::Log('Main object not exist ["'.$sName.'"]'); - } - return $oResult; - } - - /** - * @param string $sName - * @param bool - */ - public function IsMainObjectExist($sName) - { - return isset($this->aMainObjectList[$sName]); - } - - /** - * @param string $sName - * @param mixed $oObject - */ - public function SetMainObject($sName, &$oObject) - { - CApi::Log('Set main object ["'.$sName.'", '.get_class($oObject).' $oObject]'); - $this->aMainObjectList[$sName] = $oObject; - } - - /** - * @param string $sName - */ - public function DeleteMainObject($sName) - { - if (isset($this->aMainObjectList[$sName])) - { - CApi::Log('Delete main object ["'.$sName.'"]'); - unset($this->aMainObjectList[$sName]); - } - } - - /** - * @param string $sInitType - * @param string $sTab - * @param ap_Screen $oScreen - * @return void - */ - protected function initCurrentScreenByModules($sInitType, $sTab, ap_Screen &$oScreen) - { - foreach ($this->aModules as /* @var $oModule ap_Module */ $oModule) - { - if ($oModule->IsInTab($sTab)) - { - $oModule->InitScreen($sInitType, $oScreen); - } - } - } - - /** - * @param string $sTab - * @return string - */ - protected function initPostActionModules($sTab) - { - $sResult = '?root'; - if (!$this->IsOnlyReadAuthType()) - { - foreach ($this->aModules as /* @var $oModule ap_Module */ $oModule) - { - if ($oModule->IsInTab($sTab)) - { - $sModuleResult = $oModule->InitPostAction($sTab); - if (false !== $sModuleResult) - { - $sResult = $sModuleResult; - } - } - } - } - else - { - $this->ShowError(AP_LANG_ADMIN_ONLY_READ); - } - - return $sResult; - } - - /** - * @param string $sTab - * @return void - */ - protected function initPopActionModules($sTab) - { - if ($this->IsAuth()) - { - if (!$this->IsOnlyReadAuthType()) - { - foreach ($this->aModules as /* @var $oModule ap_Module */ $oModule) - { - if ($oModule->IsInTab($sTab)) - { - $oModule->InitPopAction($sTab); - } - } - } - else - { - echo AP_LANG_ADMIN_ONLY_READ; - } - } - else - { - echo AP_LANG_LOGIN_ACCESS_ERROR; - } - } - - /** - * @param string $sTab - * @return void - */ - protected function initBlankActionModules($sTab) - { - if ($this->IsAuth()) - { - if (!$this->IsOnlyReadAuthType()) - { - foreach ($this->aModules as /* @var $oModule ap_Module */ $oModule) - { - if ($oModule->IsInTab($sTab)) - { - $oModule->initBlankAction($sTab); - } - } - } - else - { - echo AP_LANG_ADMIN_ONLY_READ; - } - } - else - { - echo AP_LANG_LOGIN_ACCESS_ERROR; - } - } - - /** - * @param string $sTab - * @return void - */ - protected function initAjaxActionModules($sTab) - { - $sError = ''; - $sMessage = ''; - $sRef = ''; - if ($this->IsAuth()) - { - if (!$this->IsOnlyReadAuthType()) - { - try - { - foreach ($this->aModules as /* @var $oModule ap_Module */ $oModule) - { - if ($oModule->IsInTab($sTab)) - { - $oModule->InitAjaxAction('Pre', $sTab, $sMessage, $sError, $sRef); - } - } - if (empty($sError)) - { - foreach ($this->aModules as /* @var $oModule ap_Module */ $oModule) - { - if ($oModule->IsInTab($sTab)) - { - $oModule->InitAjaxAction('', $sTab, $sMessage, $sError, $sRef); - } - } - } - if (empty($sError)) - { - foreach ($this->aModules as /* @var $oModule ap_Module */ $oModule) - { - if ($oModule->IsInTab($sTab)) - { - $oModule->InitAjaxAction('Post', $sTab, $sMessage, $sError, $sRef); - } - } - } - } - catch (Exception $oException) - { - if (empty($sError)) - { - $sError = $oException->getMessage(); - } - } - } - else - { - $sError = AP_LANG_ADMIN_ONLY_READ; - } - } - else - { - $sError = AP_LANG_LOGIN_ACCESS_ERROR; - } - - $sOb = @ob_get_contents(); - @ob_clean(); - - if (0 < strlen($sOb)) - { - CApi::Log(AP_CRLF.$sOb, ELogLevel::Error); - if (!empty($sError)) - { - $sError = 'Json parse error'; - } - } - - $sAjaxResult = '{ "null": "null"'; - if (!empty($sError)) - { - $sAjaxResult .= ', "error": "'.ap_Utils::ReBuildStringToJavaScript($sError, '"').'"'; - } - else if (!empty($sMessage)) - { - $sAjaxResult .= ', "message": "'.ap_Utils::ReBuildStringToJavaScript($sMessage, '"').'"'; - } - if (!empty($sRef)) - { - $sAjaxResult .= ', "ref": "'.ap_Utils::ReBuildStringToJavaScript($sRef, '"').'"'; - if (!empty($sError)) - { - $this->ShowError($sError); - } - else if (!empty($sMessage)) - { - $this->ShowMessage($sMessage); - } - } - $sAjaxResult .= ' }'; - - echo $sAjaxResult; - - CApi::Log('AJAX: '.$sAjaxResult); - } - - /** - * @param string $sModuleName - * @param string $sModulFunction - * @param array $aArg = array() - * @return mixed - */ - public function CallModuleFunction($sModuleName, $sModulFunction, $aArg = array()) - { - $mResult = false; - if (isset($this->aModules[$sModuleName]) && is_callable(array(&$this->aModules[$sModuleName], $sModulFunction))) - { - $mResult = call_user_func_array(array(&$this->aModules[$sModuleName], $sModulFunction), $aArg); - } - return $mResult; - } - - /** - * @param string $sModuleName - * @return bool - */ - public function IsModuleInit($sModuleName) - { - return isset($this->aModules[$sModuleName]); - } - - /** - * @return bool - */ - protected static function initInclude() - { - static $bIsInclude = false; - - $bResult = true; - if (!$bIsInclude) - { - $sRp = self::RootPath(); - include_once $sRp.'/../libraries/afterlogic/api.php'; - CSession::$sSessionName = 'PHPWMADMINSESSID'; - - include_once $sRp.'/core/constants.php'; - include_once $sRp.'/core/utils.php'; - include_once $sRp.'/core/modules.php'; - include_once $sRp.'/core/screens.php'; - - include_once $sRp.'/core/screens/simple.php'; - include_once $sRp.'/core/screens/standard.php'; - include_once $sRp.'/core/screens/table.php'; - - $sApVersion = @file_get_contents(self::RootPath().'VERSION'); - define('AP_VERSION', (false === $sApVersion) ? '0.0.0' : $sApVersion); - $bIsInclude = true; - $bResult = true; - } - - return $bResult; - } - - /** - * @return void - */ - protected static function initDataPath() - { - $dataPath = 'data'; - if (!defined('AP_DATA_FOLDER') && @file_exists(self::GetWebMailPath().'inc_settings_path.php')) - { - include self::GetWebMailPath().'inc_settings_path.php'; - } - - if (!defined('AP_DATA_FOLDER') && null !== $dataPath) - { - define('AP_DATA_FOLDER', ap_Utils::GetFullPath($dataPath, self::GetWebMailPath())); - } - } - - /** - * @param string $sDesc - */ - public function ShowMessage($sDesc) - { - CSession::Set(AP_SESS_MESSAGE, $sDesc); - } - - /** - * @param string $sDesc - */ - public function ShowError($sDesc) - { - CSession::Set(AP_SESS_ERROR, $sDesc); - } - - /** - * @return bool - */ - public function IsAuth() - { - return $this->bIsAuth; - } - - /** - * @param bool $bIsAuth - */ - public function SetIsAuth($bIsAuth) - { - $this->bIsAuth = $bIsAuth; - } - - /** - * @return int - */ - public function AuthType() - { - return $this->iAuthType; - } - - /** - * @return int - */ - public function TenantId() - { - return $this->iTenantId; - } - - /** - * @return bool - */ - public function IsSuperAdminAuthType() - { - return AP_SESS_AUTH_TYPE_SUPER_ADMIN === $this->iAuthType; - } - - /** - * @return bool - */ - public function IsTenantAuthType() - { - return AP_SESS_AUTH_TYPE_TENANT === $this->iAuthType; - } - - /** - * @return bool - */ - public function IsOnlyReadAuthType() - { - return AP_SESS_AUTH_TYPE_SUPER_ADMIN_ONLYREAD === $this->iAuthType; - } - - /** - * @param int $iAuthType - */ - public function SetAuthType($iAuthType) - { - $this->iAuthType = $iAuthType; - - if (!$this->IsSuperAdminAuthType()) - { - $this->RemoveTabs( - array(AP_TAB_TENANTS, AP_TAB_CHANNELS) - ); - } - } - - /** - * @param array $aDomainsIds - */ - public function SetAuthDomains($aDomainsIds) - { - $this->aAuthDomains = $aDomainsIds; - } - - /** - * @param int $iTenantId - */ - public function SetAuthTenantId($iTenantId) - { - $this->iTenantId = $iTenantId; - } - - /** - * @return string | false - */ - public static function AdminDataFolder() - { - return defined('AP_DATA_FOLDER') ? AP_DATA_FOLDER : false; - } - - /** - * @return string - */ - public static function ClearAdminVersion() - { - return preg_replace('/[^\d]/', '', AP_VERSION); - } - - /** - * @return string - */ - public static function GetWebMailPath() - { - return self::RootPath().'/../'; - } - - /** - * @return string - */ - public static function RootPath() - { - defined('AP_ROOTPATH') || define('AP_ROOTPATH', rtrim(dirname(__FILE__).'/../', '/\\').'/'); - return AP_ROOTPATH; - } - - /** - * @return bool - */ - public function PType() - { - return $this->PType; - } - - /** - * @return bool - */ - public function XType() - { - return $this->XType; - } - - /** - * @return bool - */ - public function RType() - { - return $this->RType; - } + */ + +class CAdminPanel +{ + /** + * @var bool + */ + public $PType; + + /** + * @var bool + */ + public $LType; + + /** + * @var bool + */ + public $XType; + + /** + * @var bool + */ + public $RType; + + /** + * @var bool + */ + public $AType; + + /** + * @var array + */ + protected $aModules; + + /** + * @var object + */ + protected $oCurrentScreen; + + /** + * @var array + */ + protected $aJsFiles; + + /** + * @var array + */ + protected $aJsVars; + + /** + * @var array + */ + protected $aCssFiles; + + /** + * @var array + */ + protected $aInitJsText; + + /** + * @var bool + */ + protected $bIsAuth; + + /** + * @var int + */ + protected $iAuthType; + + /** + * @var array + */ + protected $aAuthDomains; + + /** + * @var int + */ + protected $iTenantId; + + /** + * @var array + */ + protected $aTabs; + + /** + * @var string + */ + protected $sTabsInfo; + + /** + * @var string + */ + protected $sTab; + + /** + * @var bool + */ + protected $bShowScreen; + + /** + * @var array + */ + protected $aMainObjectList; + + /** + * @var array + */ + protected $aTabsSort; + + /** + * @var string + */ + protected $sHelpUrl; + + /** + * @return CAdminPanel + */ + public function __construct($sIndexFileName = null) + { + $GLOBALS['WM-ADMINPANEL-RUN'] = true; // TODO global is evil + + $this->aModules = array(); + $this->bShowScreen = true; + + $this->bIsAuth = false; + $this->PType = false; + $this->XType = false; + $this->LType = false; + $this->RType = false; + $this->AType = false; + + $this->sHelpUrl = ''; + + $this->iAuthType = null; + $this->aAuthDomains = null; + $this->iTenantId = 0; + + $this->bSessionIsStarted = false; + + $this->aCssFiles = array(); + $this->aJsFiles = array(); + $this->aJsVars = array(); + $this->aInitJsText = array(); + $this->aTabs = array(); + $this->aModules = array(); + $this->sTab = ''; + $this->sTabsInfo = ''; + + $this->aMainObjectList = array(); + $this->aTabsSort = array(); + + if (null !== $sIndexFileName) + { + $sIndexFileName = basename($sIndexFileName); + if (strlen($sIndexFileName) > 3) + { + define('AP_INDEX_FILE', $sIndexFileName); + } + } + + defined('AP_INDEX_FILE') || define('AP_INDEX_FILE', 'index.php'); + + $this->bSessionIsStarted = self::initInclude(); + + self::initDataPath(); + + $this->initAdminPanel(); + } + + public function Title() + { + echo CApi::I18N('ADMIN_PANEL/TITLE'); + } + + public function End() + { + return $this; + } + + public function Run() + { + @ob_start(); + if ($this->bShowScreen) + { + include self::RootPath().'core/templates/main.php'; + } + return $this; + } + + /** + * @return void + */ + protected function resortTabs() + { + $bResult = $aTemp = array(); + foreach ($this->aTabs as $aTab) + { + $aTemp[$aTab[1]] = $aTab; + } + + foreach ($this->aTabsSort as $sTab) + { + if (in_array($sTab, array_keys($aTemp))) + { + $bResult[] = $aTemp[$sTab]; + } + } + + $this->aTabs = $bResult; + } + + /** + * @return object + */ + protected function initScreen($sTab) + { + $oScreen = null; + if ($this->IsAuth()) + { + $aScreenMap = array( + AP_TAB_COMMON => 'ap_Standard_Screen', + AP_TAB_DOMAINS => 'ap_Table_Screen', + AP_TAB_USERS => 'ap_Table_Screen', + AP_TAB_TENANTS => 'ap_Table_Screen', + AP_TAB_CHANNELS => 'ap_Table_Screen', + AP_TAB_SYSTEM => 'ap_Standard_Screen' + ); + + if (isset($aScreenMap[$sTab])) + { + $oScreen = new $aScreenMap[$sTab]($this); + $oScreen->SetScreenName('screen'.ucfirst($sTab)); + } + + if (empty($_COOKIE['FTE_'])) + { + if (@is_dir(self::GetWebMailPath().'install')) + { + $this->JsAddInitText('OnlineMsgError(\''.CApi::I18N('ADMIN_PANEL/MSG_INSTALLER_FOUND').'\');'); + } + + $oLicApiManager = /* @var $oLicApiManager CApiLicensingManager */ CApi::Manager('licensing'); + if ($oLicApiManager && $oLicApiManager->IsValidKey()) + { + $iType = $oLicApiManager->GetLicenseType(); + $iExpiredSeconds = 0; + if (!$oLicApiManager->IsValidLimit(true)) + { + $this->JsAddInitText('OnlineMsgError(\''.CApi::I18N('ADMIN_PANEL/MSG_LICENSE_USER_LIMIT').'\');'); + } + else if (in_array($iType, array(3, 10)) && $oLicApiManager->IsAboutToExpire($iExpiredSeconds)) + { + $this->JsAddInitText('OnlineMsgError(\''. + sprintf(CApi::I18N('ADMIN_PANEL/MSG_LICENSE_TRIAL_ENDS'), + ceil($iExpiredSeconds / 60 / 60 / 24)). + '\');'); + } + } + + @setcookie('FTE_', true, time() + 600); + } + } + else + { + include_once self::RootPath().'core/screens/login.php'; + $oScreen = new ap_Login_Screen($this); + $oScreen->SetScreenName('screenLogin'); + } + + return $oScreen; + } + + /** + * @return void + */ + public function IncludeScreen() + { + if (!$this->oCurrentScreen) + { + $this->oCurrentScreen = new ap_Simple_Screen($this, 'error.php'); + $this->oCurrentScreen->Data->SetValue('ErrorDesc', 'Admin Panel internal error.'); + } + + if (0 < strlen(CSession::get('SESSION_LOGIN_WARNING', ''))) + { + $this->oCurrentScreen = new ap_Simple_Screen($this, 'login-warning.php'); + $this->oCurrentScreen->Data->SetValue('TxtDesc', CSession::get('SESSION_LOGIN_WARNING', '')); + CSession::Set('SESSION_LOGIN_WARNING', ''); + } + + $this->oCurrentScreen->Run(); + } + + /** + * @return void + */ + public function IncludeCss() + { + foreach ($this->aCssFiles as $sCssFile) + { + echo ''; + } + } + + /** + * @return void + */ + public function IncludeJs() + { + $aLang = include self::RootPath().'core/lang2js.php'; + echo ''; + + echo AP_CRLF; + foreach ($this->aJsFiles as $sJsFile) + { + echo ''; + } + echo ''.AP_CRLF; + } + + /** + * @return void + */ + public function IncludeJsVars() + { + echo ''; + } + + /** + * @param string $sCssFile + */ + public function CssAddFile($sCssFile) + { + $this->aCssFiles[] = $sCssFile; + } + + /** + * @param string $sJsFile + */ + public function JsAddFile($sJsFile) + { + $this->aJsFiles[] = $sJsFile; + } + + /** + * @param string $sName + * @param string $sValue + */ + public function JsAddVar($sName, $sValue) + { + $this->aJsVars[$sName] = $sValue; + } + + /** + * @param string $sJsInitText + */ + public function JsAddInitText($sJsInitText) + { + $this->aInitJsText[] = $sJsInitText; + } + + public function WriteTabs() + { + echo '
'; + + $this->resortTabs(); + + $bIsFirst = true; + foreach ($this->aTabs as $aTab) + { + $sClassToAdd = ''; + if (true === $bIsFirst) + { + $sClassToAdd = ' first'; + $bIsFirst = false; + } + + $sClass = ($this->sTab == $aTab[1]) ? 'wm_tabslist_item wm_active_tab' : 'wm_tabslist_item'; + $sClass .= $sClassToAdd; + + echo ''; + } + + if (0 < strlen($this->sTabsInfo)) + { + echo $this->sTabsInfo; + } + + echo ''; + if (0 < strlen($this->sHelpUrl)) + { + echo ''; + } + echo '
'; + } + + /** + * @param CTenant $oTenant + */ + public function SetTenantTabsInfo($oTenant) + { + $this->sTabsInfo = ''; + if ($oTenant) + { + $this->sTabsInfo = '
'; + $this->sTabsInfo .= CApi::I18N('ADMIN_PANEL/RESOURCES_USAGE').': '.CApi::I18N('ADMIN_PANEL/RESOURCES_USERS').' - '; + $this->sTabsInfo .= $oTenant->getUserCount(); + + if (0 < $oTenant->UserCountLimit) + { + $this->sTabsInfo .= ' '.sprintf(CApi::I18N('ADMIN_PANEL/RESOURCES_USERS_MAX'),$oTenant->UserCountLimit); + } + + $iUsed = 0; + if (0 < $oTenant->QuotaInMB) + { + $iUsed = floor(($oTenant->AllocatedSpaceInMB / $oTenant->QuotaInMB) * 100); + $this->sTabsInfo .='; '.CApi::I18N('ADMIN_PANEL/RESOURCES_DISK').' - '. $iUsed.'% ('.$oTenant->AllocatedSpaceInMB.' MB) '.CApi::I18N('ADMIN_PANEL/RESOURCES_DISK_OF').' '.$oTenant->QuotaInMB.' MB '.CApi::I18N('ADMIN_PANEL/RESOURCES_DISK_ALLOC'); + } + else + { + $this->sTabsInfo .='; '.CApi::I18N('ADMIN_PANEL/RESOURCES_DISK').' - '. $oTenant->AllocatedSpaceInMB.' MB '.CApi::I18N('ADMIN_PANEL/RESOURCES_DISK_ALLOC'); + } + + $this->sTabsInfo .= '
'; + } + } + + /** + * @return string + */ + public function Tab() + { + return $this->sTab; + } + + /** + * @return array + */ + public function &GetTabs() + { + return $this->aTabs; + } + + /** + * @return array + */ + public function RemoveTabs($aTabNames) + { + if (is_array($aTabNames)) + { + $aNewTabs = array(); + $aTabs =& $this->aTabs; + + foreach ($aTabs as $aTabItem) + { + if (!in_array($aTabItem[1], $aTabNames)) + { + $aNewTabs[] = $aTabItem; + } + } + + $this->aTabs = $aNewTabs; + } + } + + /** + * @return void + */ + protected function initAdminPanel() + { + $this->RType = (bool) CApi::GetConf('tenant', false); + $this->AType = !!CApi::Manager('collaboration'); + + $this->aTabsSort = array( + AP_TAB_COMMON, + AP_TAB_DOMAINS, + AP_TAB_USERS, + AP_TAB_TENANTS, + AP_TAB_CHANNELS, + AP_TAB_SYSTEM + ); + + $GLOBALS[AP_START_TIME] = ap_Utils::Microtime(); + $GLOBALS[AP_DB_COUNT] = 0; + + if (isset($_GET['logout'])) + { + CSession::ClearAll(); + CApi::Location(AP_INDEX_FILE.'?login'); + } + + if (isset($_GET['tab']) && strlen($_GET['tab']) > 0) + { + CSession::Set(AP_SESS_TAB, $_GET['tab']); + } + else + { + CSession::Set(AP_SESS_TAB, CSession::get(AP_SESS_TAB, AP_TAB_DEFAULT)); + } + + $this->sTab = CSession::get(AP_SESS_TAB, AP_TAB_DEFAULT); + + try + { + $this->CssAddFile('static/styles/style.css'); + $this->JsAddFile('static/js/common.js'); + $this->JsAddFile('static/js/jquery.js'); + $this->JsAddFile('static/js/knockout-2.3.0.js'); + + if (!CApi::IsValid()) + { + return false; + } + + $this->initModules(); + $this->initType(); + $this->initAuth(); + + $this->sHelpUrl = ''; + $sUrl = $this->IsTenantAuthType() ? + (string) CApi::GetConf('labs.custom-tenant-help-url', '') : + (string) CApi::GetConf('labs.custom-admin-help-url', ''); + + if (0 < strlen($sUrl)) + { + $this->sHelpUrl = $sUrl; + } + else + { + if ($this->AType) + { + $this->sHelpUrl = 'http://www.afterlogic.com/wiki/Aurora_documentation'; + } + else if ($this->PType) + { + $this->sHelpUrl = 'http://www.afterlogic.com/wiki/WebMail_Pro_documentation'; + } + else + { + $this->sHelpUrl = 'http://www.afterlogic.com/wiki/WebMail_Lite_documentation'; + } + } + + if (isset($_GET['help'])) + { + if (0 < strlen($this->sHelpUrl)) + { + CApi::Location($this->sHelpUrl); + } + else + { + CApi::Location('?root'); + } + } + + $bResetToDefault = true; + foreach ($this->aTabs as $aTab) + { + if (isset($aTab[1]) && (string) $aTab[1] === (string) $this->sTab) + { + $bResetToDefault = false; + break; + } + } + + if ($bResetToDefault) + { + $this->sTab = $this->IsTenantAuthType() ? AP_TAB_TENANT_DEFAULT : AP_TAB_DEFAULT; + CSession::Set(AP_SESS_TAB, $this->sTab); + } + + if (isset($_GET['submit']) && isset($_POST) && 0 < count($_POST)) + { + $this->bShowScreen = false; + $sReturnRef = $this->initPostActionModules($this->sTab); + CApi::Location(AP_INDEX_FILE.$sReturnRef); + } + else if (isset($_GET['pop'])) + { + $this->bShowScreen = false; + $this->initPopActionModules($this->sTab); + } + else if (isset($_GET['blank'])) + { + $this->bShowScreen = false; + $this->initBlankActionModules($this->sTab); + } + else if (isset($_GET['ajax'])) + { + $this->bShowScreen = false; + $this->initAjaxActionModules($this->sTab); + } + else + { + $this->oCurrentScreen = $this->initScreen($this->sTab); + if ($this->oCurrentScreen) + { + $this->oCurrentScreen->PreModuleInit(); + $this->initCurrentScreenByModules('first', $this->sTab, $this->oCurrentScreen); + $this->oCurrentScreen->MiddleModuleInit(); + $this->initCurrentScreenByModules('second', $this->sTab, $this->oCurrentScreen); + $this->oCurrentScreen->EndModuleInit(); + $this->initCurrentScreenByModules('third', $this->sTab, $this->oCurrentScreen); + } + + if (CSession::Has(AP_SESS_ERROR)) + { + $this->JsAddInitText('OnlineMsgError("'. + ap_Utils::ReBuildStringToJavaScript( + nl2br(CSession::get(AP_SESS_ERROR, '')), '"').'");'); + + CSession::clear(AP_SESS_ERROR); + } + else if (CSession::Has(AP_SESS_MESSAGE)) + { + $this->JsAddInitText('OnlineMsgInfo("'. + ap_Utils::ReBuildStringToJavaScript( + nl2br(CSession::get(AP_SESS_MESSAGE, '')), '"').'");'); + + CSession::clear(AP_SESS_MESSAGE); + } + } + } + catch (Exception $oExeption) + { + $this->oCurrentScreen = new ap_Simple_Screen($this, 'error.php', array( + 'ErrorDesc' => 'Admin Panel internal error.' + )); + } + } + + /** + * @return void + */ + protected function initAuth() + { + $this->iAuthType = AP_SESS_AUTH_TYPE_NONE; + if ((isset($_GET['login']) || isset($_POST['login'])) && + (CPost::Has('AdmloginInput') || CGet::Has('AdmloginInput')) &&CPost::Has('AdmpasswordInput')) + { + $sAdmloginInput = CPost::get('AdmloginInput'); + if (CGet::Has('AdmloginInput')) + { + $sAdmloginInput = CGet::get('AdmloginInput'); + } + + $sLoginSuffix = CPost::get('LoginSuffix', ''); + if (CGet::Has('LoginSuffix')) + { + $sLoginSuffix = CGet::get('LoginSuffix', ''); + } + + if ($this->CallModuleFunction('CCommonModule', 'AuthLogin', + array($sAdmloginInput.$sLoginSuffix, CPost::get('AdmpasswordInput')))) + { + CApi::Location(AP_INDEX_FILE.'?enter'); + } + else + { + CSession::Destroy(); + CApi::Location(AP_INDEX_FILE.'?auth_error'); + } + + exit(); + } + else + { + if ($this->bSessionIsStarted) + { + $this->CallModuleFunction('CCommonModule', 'AuthCheckSet'); + if ($this->IsTenantAuthType()) + { + $aTabs =& $this->GetTabs(); + $aNewTabs = array(); + + foreach ($aTabs as $aTabValue) + { + if (in_array($aTabValue[0], array(CApi::I18N('ADMIN_PANEL/TABNAME_COMMON'), CApi::I18N('ADMIN_PANEL/TABNAME_DOMAINS'), CApi::I18N('ADMIN_PANEL/TABNAME_USERS')))) + { + $aNewTabs[] = $aTabValue; + } + } + + $aTabs = $aNewTabs; + } + } + else + { + CSession::Destroy(); + CApi::Location(AP_INDEX_FILE.'?sess_error'); + exit(); + } + } + } + + /** + * @return void + */ + protected function initType() + { + $this->CallModuleFunction('CProModule', 'InitAdminPanel', array(&$this)); + $this->CallModuleFunction('CBundleModule', 'InitAdminPanel', array(&$this)); + } + + /** + * @return void + */ + protected function initModules() + { + $aLocalModules = array(); + $this->aModules = array(); + + $sModulePath = self::RootPath().'modules/'; + if (is_dir($sModulePath)) + { + if (false !== ($rDirHandle = opendir($sModulePath))) + { + $bIsMailSuite = (bool) CApi::GetConf('mailsuite', false); + while (false !== ($sFile = readdir($rDirHandle))) + { + if ('.' !== $sFile{0} && @file_exists($sModulePath.$sFile.'/index.php')) + { + if (!$bIsMailSuite && 'bundle' === $sFile) + { + continue; + } + + $bDisabled = false; + $iSortIndex = null; + $sCurrentModule = null; + include $sModulePath.$sFile.'/index.php'; + + if (!$bDisabled && null !== $sCurrentModule && null !== $iSortIndex && class_exists($sCurrentModule)) + { + while (isset($aLocalModules[$iSortIndex])) + { + $iSortIndex++; + } + + $aLocalModules[$iSortIndex] = new $sCurrentModule($this, $sModulePath.$sFile); + } + } + } + + closedir($rDirHandle); + } + } + + ksort($aLocalModules); + + foreach ($aLocalModules as $oModule) + { + $this->aModules[get_class($oModule)] = $oModule; + } + } + + /** + * @param int $iDomainId + * @return bool + */ + public function HasAccessDomain($iDomainId) + { + static $aCache = array(); + $iDomainId = '' === $iDomainId ? 0 : (int) $iDomainId; + + if (isset($aCache[$iDomainId])) + { + return $aCache[$iDomainId]; + } + + $iTenantId = $this->TenantId(); + + $bResult = false; + if (AP_SESS_AUTH_TYPE_SUPER_ADMIN_ONLYREAD === $this->iAuthType) + { + CApi::Plugin()->RunHook('adminpanel-demo-domain-access', array($iDomainId, &$bResult)); + } + else if ((0 < $iDomainId && 0 < $iTenantId) || 0 === $iTenantId) + { + if (0 < $iTenantId) + { + $oDomainsApi = /* @var $oDomainsApi CApiDomainsManager */ CApi::Manager('domains'); + $oDomain = /* @var $oDomain CDomain */$oDomainsApi->getDomainById($iDomainId); + if ($oDomain && $iTenantId === $oDomain->IdTenant) + { + $bResult = true; + } + } + else + { + $bResult = true; + } + } + + $aCache[$iDomainId] = $bResult; + return $bResult; + } + + /** + * @param string $sName + * @return mixed + */ + public function &GetMainObject($sName) + { + $oResult = null; + if ($this->IsMainObjectExist($sName)) + { + $oResult =& $this->aMainObjectList[$sName]; + } + else + { + CApi::Log('Main object not exist ["'.$sName.'"]'); + } + return $oResult; + } + + /** + * @param string $sName + * @param bool + */ + public function IsMainObjectExist($sName) + { + return isset($this->aMainObjectList[$sName]); + } + + /** + * @param string $sName + * @param mixed $oObject + */ + public function SetMainObject($sName, &$oObject) + { + CApi::Log('Set main object ["'.$sName.'", '.get_class($oObject).' $oObject]'); + $this->aMainObjectList[$sName] = $oObject; + } + + /** + * @param string $sName + */ + public function DeleteMainObject($sName) + { + if (isset($this->aMainObjectList[$sName])) + { + CApi::Log('Delete main object ["'.$sName.'"]'); + unset($this->aMainObjectList[$sName]); + } + } + + /** + * @param string $sInitType + * @param string $sTab + * @param ap_Screen $oScreen + * @return void + */ + protected function initCurrentScreenByModules($sInitType, $sTab, ap_Screen &$oScreen) + { + foreach ($this->aModules as /* @var $oModule ap_Module */ $oModule) + { + if ($oModule->IsInTab($sTab)) + { + $oModule->InitScreen($sInitType, $oScreen); + } + } + } + + /** + * @param string $sTab + * @return string + */ + protected function initPostActionModules($sTab) + { + $sResult = '?root'; + if (!$this->IsOnlyReadAuthType()) + { + foreach ($this->aModules as /* @var $oModule ap_Module */ $oModule) + { + if ($oModule->IsInTab($sTab)) + { + $sModuleResult = $oModule->InitPostAction($sTab); + if (false !== $sModuleResult) + { + $sResult = $sModuleResult; + } + } + } + } + else + { + $this->ShowError(AP_LANG_ADMIN_ONLY_READ); + } + + return $sResult; + } + + /** + * @param string $sTab + * @return void + */ + protected function initPopActionModules($sTab) + { + if ($this->IsAuth()) + { + if (!$this->IsOnlyReadAuthType()) + { + foreach ($this->aModules as /* @var $oModule ap_Module */ $oModule) + { + if ($oModule->IsInTab($sTab)) + { + $oModule->InitPopAction($sTab); + } + } + } + else + { + echo AP_LANG_ADMIN_ONLY_READ; + } + } + else + { + echo AP_LANG_LOGIN_ACCESS_ERROR; + } + } + + /** + * @param string $sTab + * @return void + */ + protected function initBlankActionModules($sTab) + { + if ($this->IsAuth()) + { + if (!$this->IsOnlyReadAuthType()) + { + foreach ($this->aModules as /* @var $oModule ap_Module */ $oModule) + { + if ($oModule->IsInTab($sTab)) + { + $oModule->initBlankAction($sTab); + } + } + } + else + { + echo AP_LANG_ADMIN_ONLY_READ; + } + } + else + { + echo AP_LANG_LOGIN_ACCESS_ERROR; + } + } + + /** + * @param string $sTab + * @return void + */ + protected function initAjaxActionModules($sTab) + { + $sError = ''; + $sMessage = ''; + $sRef = ''; + if ($this->IsAuth()) + { + if (!$this->IsOnlyReadAuthType()) + { + try + { + foreach ($this->aModules as /* @var $oModule ap_Module */ $oModule) + { + if ($oModule->IsInTab($sTab)) + { + $oModule->InitAjaxAction('Pre', $sTab, $sMessage, $sError, $sRef); + } + } + if (empty($sError)) + { + foreach ($this->aModules as /* @var $oModule ap_Module */ $oModule) + { + if ($oModule->IsInTab($sTab)) + { + $oModule->InitAjaxAction('', $sTab, $sMessage, $sError, $sRef); + } + } + } + if (empty($sError)) + { + foreach ($this->aModules as /* @var $oModule ap_Module */ $oModule) + { + if ($oModule->IsInTab($sTab)) + { + $oModule->InitAjaxAction('Post', $sTab, $sMessage, $sError, $sRef); + } + } + } + } + catch (Exception $oException) + { + if (empty($sError)) + { + $sError = $oException->getMessage(); + } + } + } + else + { + $sError = AP_LANG_ADMIN_ONLY_READ; + } + } + else + { + $sError = AP_LANG_LOGIN_ACCESS_ERROR; + } + + $sOb = @ob_get_contents(); + @ob_clean(); + + if (0 < strlen($sOb)) + { + CApi::Log(AP_CRLF.$sOb, ELogLevel::Error); + if (!empty($sError)) + { + $sError = 'Json parse error'; + } + } + + $sAjaxResult = '{ "null": "null"'; + if (!empty($sError)) + { + $sAjaxResult .= ', "error": "'.ap_Utils::ReBuildStringToJavaScript($sError, '"').'"'; + } + else if (!empty($sMessage)) + { + $sAjaxResult .= ', "message": "'.ap_Utils::ReBuildStringToJavaScript($sMessage, '"').'"'; + } + if (!empty($sRef)) + { + $sAjaxResult .= ', "ref": "'.ap_Utils::ReBuildStringToJavaScript($sRef, '"').'"'; + if (!empty($sError)) + { + $this->ShowError($sError); + } + else if (!empty($sMessage)) + { + $this->ShowMessage($sMessage); + } + } + $sAjaxResult .= ' }'; + + echo $sAjaxResult; + + CApi::Log('AJAX: '.$sAjaxResult); + } + + /** + * @param string $sModuleName + * @param string $sModulFunction + * @param array $aArg = array() + * @return mixed + */ + public function CallModuleFunction($sModuleName, $sModulFunction, $aArg = array()) + { + $mResult = false; + if (isset($this->aModules[$sModuleName]) && is_callable(array(&$this->aModules[$sModuleName], $sModulFunction))) + { + $mResult = call_user_func_array(array(&$this->aModules[$sModuleName], $sModulFunction), $aArg); + } + return $mResult; + } + + /** + * @param string $sModuleName + * @return bool + */ + public function IsModuleInit($sModuleName) + { + return isset($this->aModules[$sModuleName]); + } + + /** + * @return bool + */ + protected static function initInclude() + { + static $bIsInclude = false; + + $bResult = true; + if (!$bIsInclude) + { + $sRp = self::RootPath(); + include_once $sRp.'/../libraries/afterlogic/api.php'; + CSession::$sSessionName = 'PHPWMADMINSESSID'; + + include_once $sRp.'/core/constants.php'; + include_once $sRp.'/core/utils.php'; + include_once $sRp.'/core/modules.php'; + include_once $sRp.'/core/screens.php'; + + include_once $sRp.'/core/screens/simple.php'; + include_once $sRp.'/core/screens/standard.php'; + include_once $sRp.'/core/screens/table.php'; + + $sApVersion = @file_get_contents(self::RootPath().'VERSION'); + define('AP_VERSION', (false === $sApVersion) ? '0.0.0' : $sApVersion); + $bIsInclude = true; + $bResult = true; + } + + return $bResult; + } + + /** + * @return void + */ + protected static function initDataPath() + { + $dataPath = 'data'; + if (!defined('AP_DATA_FOLDER') && @file_exists(self::GetWebMailPath().'inc_settings_path.php')) + { + include self::GetWebMailPath().'inc_settings_path.php'; + } + + if (!defined('AP_DATA_FOLDER') && null !== $dataPath) + { + define('AP_DATA_FOLDER', ap_Utils::GetFullPath($dataPath, self::GetWebMailPath())); + } + } + + /** + * @param string $sDesc + */ + public function ShowMessage($sDesc) + { + CSession::Set(AP_SESS_MESSAGE, $sDesc); + } + + /** + * @param string $sDesc + */ + public function ShowError($sDesc) + { + CSession::Set(AP_SESS_ERROR, $sDesc); + } + + /** + * @return bool + */ + public function IsAuth() + { + return $this->bIsAuth; + } + + /** + * @param bool $bIsAuth + */ + public function SetIsAuth($bIsAuth) + { + $this->bIsAuth = $bIsAuth; + } + + /** + * @return int + */ + public function AuthType() + { + return $this->iAuthType; + } + + /** + * @return int + */ + public function TenantId() + { + return $this->iTenantId; + } + + /** + * @return bool + */ + public function IsSuperAdminAuthType() + { + return AP_SESS_AUTH_TYPE_SUPER_ADMIN === $this->iAuthType; + } + + /** + * @return bool + */ + public function IsTenantAuthType() + { + return AP_SESS_AUTH_TYPE_TENANT === $this->iAuthType; + } + + /** + * @return bool + */ + public function IsOnlyReadAuthType() + { + return AP_SESS_AUTH_TYPE_SUPER_ADMIN_ONLYREAD === $this->iAuthType; + } + + /** + * @param int $iAuthType + */ + public function SetAuthType($iAuthType) + { + $this->iAuthType = $iAuthType; + + if (!$this->IsSuperAdminAuthType()) + { + $this->RemoveTabs( + array(AP_TAB_TENANTS, AP_TAB_CHANNELS) + ); + } + } + + /** + * @param array $aDomainsIds + */ + public function SetAuthDomains($aDomainsIds) + { + $this->aAuthDomains = $aDomainsIds; + } + + /** + * @param int $iTenantId + */ + public function SetAuthTenantId($iTenantId) + { + $this->iTenantId = $iTenantId; + } + + /** + * @return string | false + */ + public static function AdminDataFolder() + { + return defined('AP_DATA_FOLDER') ? AP_DATA_FOLDER : false; + } + + /** + * @return string + */ + public static function ClearAdminVersion() + { + return preg_replace('/[^\d]/', '', AP_VERSION); + } + + /** + * @return string + */ + public static function GetWebMailPath() + { + return self::RootPath().'/../'; + } + + /** + * @return string + */ + public static function RootPath() + { + defined('AP_ROOTPATH') || define('AP_ROOTPATH', rtrim(dirname(__FILE__).'/../', '/\\').'/'); + return AP_ROOTPATH; + } + + /** + * @return bool + */ + public function PType() + { + return $this->PType; + } + + /** + * @return bool + */ + public function XType() + { + return $this->XType; + } + + /** + * @return bool + */ + public function RType() + { + return $this->RType; + } } \ No newline at end of file diff --git a/adminpanel/core/modules.php b/adminpanel/core/modules.php index 7cc0b288..78b03fbf 100644 --- a/adminpanel/core/modules.php +++ b/adminpanel/core/modules.php @@ -1,544 +1,544 @@ -aTabs = array(); - $this->aQueryActions = array(); - - $this->oAdminPanel =& $oAdminPanel; - $this->sPath = $sPath; - $this->sWebModulePath = 'modules/'.basename($sPath); - - $this->lastErrorCode = 0; - $this->lastErrorMessage = ''; - - $this->initInclude(); - - $this->oPopulateData = null; - $this->oStandardPostAction = null; - $this->oStandardPopAction = null; - $this->oTableAjaxAction = null; - - $this->oTableList = null; - } - - /** - * @return int - */ - public function getLastErrorCode() - { - return $this->lastErrorCode; - } - - /** - * @return string - */ - public function GetLastErrorMessage() - { - return $this->lastErrorMessage; - } - - /** - * @param string $sTab - * @return bool - */ - public function IsInTab($sTab) - { - return in_array($sTab, $this->aTabs); - } - - /** - * @param string $sTab - * @return bool - */ - public function PType() - { - return $this->oAdminPanel->PType(); - } - - /** - * @param string $sInitType - * @param ap_Screen $oScreen - * @return bool - */ - public function InitScreen($sInitType, ap_Screen &$oScreen) - { - $sTab = $this->oAdminPanel->Tab(); - if ($oScreen instanceof ap_Standard_Screen) - { - if ('first' === $sInitType) - { - $this->initStandardMenuByTab($sTab, $oScreen); - } - else if ('second' === $sInitType) - { - $this->initStandardMainByTab($sTab, $oScreen); - } - else if ('third' === $sInitType) - { - # - } - } - else if ($oScreen instanceof ap_Table_Screen) - { - if ('first' === $sInitType) - { - $this->initTableListFilter($sTab, $oScreen); - $this->initTableTopMenu($sTab, $oScreen); - $this->initTableListHeaders($sTab, $oScreen); - $this->initTableMainSwitchersPre($sTab, $oScreen); - } - else if ('second' === $sInitType) - { - $this->initTableList($sTab, $oScreen); - $this->initTableMainSwitchers($sTab, $oScreen); - $this->initTableMainPopulateData($sTab, $oScreen); - } - else if ('third' === $sInitType) - { - $this->initTableMainSwitchersPost($sTab, $oScreen); - } - } - } - - /** - * @param string $sTab - * @param ap_Screen $oScreen - */ - protected function initTableTopMenu($sTab, ap_Screen &$oScreen) {} - - /** - * @param string $sTab - * @param ap_Screen $oScreen - */ - protected function initTableListHeaders($sTab, ap_Screen &$oScreen) {} - - /** - * @param string $sTab - * @param ap_Screen $oScreen - */ - protected function initTableList($sTab, ap_Screen &$oScreen) {} - - /** - * @param string $sTab - * @param ap_Screen $oScreen - */ - protected function initTableListFilter($sTab, ap_Screen &$oScreen) {} - - /** - * @param string $sTab - * @param ap_Screen $oScreen - */ - protected function initTableMainSwitchers($sTab, ap_Screen &$oScreen) {} - - /** - * @param string $sTab - * @param ap_Screen $oScreen - */ - protected function initTableMainSwitchersPre($sTab, ap_Screen &$oScreen) {} - - /** - * @param string $sTab - * @param ap_Screen $oScreen - */ - protected function initTableMainSwitchersPost($sTab, ap_Screen &$oScreen) {} - - /** - * @param string $sTab - * @param string $sMode - * @param ap_Screen $oScreen - */ - protected function initTableMainPopulateData($sTab, ap_Screen &$oScreen) - { - if ($this->oPopulateData && $this->IsInTab($sTab)) - { - $sTabMode = ucfirst($sTab).'Main'.ucfirst($this->getQueryAction()); - - $oScreen->Data->SetValue('sysTab', $sTab); - $oScreen->Data->SetValue('sysQueryAction', $this->getQueryAction()); - - CApi::Log('call '.get_class($this).'->PopulateData->'.$sTabMode.'()'); - if (method_exists($this->oPopulateData, $sTabMode)) - { - $this->oPopulateData->{$sTabMode}($oScreen); - } - } - } - - /** - * @return string - */ - protected function getQueryAction() - { - $sResult = ''; - foreach ($this->aQueryActions as $sKey) - { - if (isset($_GET[$sKey])) - { - $sResult = $sKey; - break; - } - } - return $sResult; - } - - /** - * @param string $sTab - * @param ap_Screen $oScreen - */ - protected function initStandardMenuByTab($sTab, ap_Screen &$oScreen) {} - - /** - * @param string $sTab - * @param string $sMode - * @param ap_Screen $oScreen - */ - protected function initStandardMainByTab($sTab, ap_Screen &$oScreen) - { - if ($this->oPopulateData && $this->IsInTab($sTab)) - { - $sMode = $oScreen->GetCurrentMode(); - $sTabMode = ucfirst($sTab).ucfirst($sMode); - - CApi::Log('call '.get_class($this).'->PopulateData->'.$sTabMode.'()'); - if (method_exists($this->oPopulateData, $sTabMode)) - { - $oScreen->Data->SetValue('sysTab', $sTab); - $oScreen->Data->SetValue('sysMode', $sMode); - - $this->oPopulateData->{$sTabMode}($oScreen); - } - } - } - - /** - * @return string - */ - public function InitPostAction($sTab) - { - $sResult = false; - if ($this->oStandardPostAction && $this->IsInTab($sTab) && $this->oAdminPanel->IsAuth() && !$this->oAdminPanel->IsOnlyReadAuthType()) - { - $sResult = '?root'; - $sPostId = CPost::get('form_id', 'null'); - $sPostActionFunction = ucfirst($sTab).ucfirst($sPostId); - $sPostActionFunction .= ('collection' === $sPostId && null !== CPost::get('action', null)) - ? ucfirst(CPost::get('action', '')) : ''; - - CApi::Log('call '.get_class($this).'->StandardPostAction->'.$sPostActionFunction.'()'); - if (!empty($sPostId) && method_exists($this->oStandardPostAction, $sPostActionFunction)) - { - $sActionResult = $this->oStandardPostAction->$sPostActionFunction(); - if (!empty($this->oStandardPostAction->LastError)) - { - $this->oAdminPanel->ShowError($this->oStandardPostAction->LastError); - } - else if (!empty($this->oStandardPostAction->LastMessage)) - { - $this->oAdminPanel->ShowMessage($this->oStandardPostAction->LastMessage); - } - - if (empty($sActionResult)) - { - $sResult = $sActionResult; - } - } - } - return $sResult; - } - - /** - * @return void - */ - public function InitPopAction($sTab) - { - if ($this->oStandardPostAction && $this->IsInTab($sTab)) - { - $sPopActionFunction = ucfirst($sTab); - - CApi::Log('call '.get_class($this).'->StandardPopAction->'.$sPopActionFunction.'()'); - if (method_exists($this->oStandardPopAction, $sPopActionFunction)) - { - $this->oStandardPopAction->$sPopActionFunction(); - } - } - } - - /** - * @return void - */ - public function initBlankAction($sTab) - { - if ($this->oBlankAction && $this->IsInTab($sTab)) - { - $sType = isset($_GET['type']) ? $_GET['type'] : null; - $sBlankActionFunction = ucfirst($sTab).ucfirst($sType); - - CApi::Log('call '.get_class($this).'->BlankAction->'.$sBlankActionFunction.'()'); - if (method_exists($this->oBlankAction, $sBlankActionFunction)) - { - $this->oBlankAction->$sBlankActionFunction(); - } - } - } - - /** - * @return void - */ - public function InitAjaxAction($sPostName, $sTab, &$sMessage, &$sError, &$sRef) - { - if ($this->oTableAjaxAction && $this->IsInTab($sTab)) - { - $sQueryAction = CPost::get('QueryAction', ''); - - $sAjaxActionFunction = ucfirst($sTab).ucfirst($sQueryAction). - ((empty($sPostName)) ? '' : '_'.$sPostName); - - if (method_exists($this->oTableAjaxAction, $sAjaxActionFunction)) - { - CApi::Log('call '.get_class($this).'->TableAjaxAction->'.$sAjaxActionFunction.'()'); - $this->oTableAjaxAction->$sAjaxActionFunction(); - - if (!empty($this->oTableAjaxAction->LastError)) - { - $sError = $this->oTableAjaxAction->LastError; - } - else if (!empty($this->oTableAjaxAction->LastMessage)) - { - $sMessage = $this->oTableAjaxAction->LastMessage; - } - - if (!empty($this->oTableAjaxAction->Ref)) - { - $sRef = $this->oTableAjaxAction->Ref; - } - - if (!empty($sError)) - { - CApi::Log('function '.$sAjaxActionFunction.'() return $sError = '.$sError, ELogLevel::Error); - } - } - } - } - - /** - * @return void - */ - abstract protected function initInclude(); - - /** - * @param string $sCssFile - */ - public function CssAddFile($sCssFile) - { - $this->oAdminPanel->CssAddFile($this->WebModulePath().'/js/'.$sCssFile); - } - - /** - * @param string $sJsFile - */ - public function JsAddFile($sJsFile) - { - $this->oAdminPanel->JsAddFile($this->WebModulePath().'/js/'.$sJsFile); - } - - /** - * @param string $sJsFile - */ - public function JsAddVar($sName, $sValue) - { - $this->oAdminPanel->JsAddVar($sName, $sValue); - } - - /** - * @return string - */ - public function WebModulePath() - { - return $this->sWebModulePath; - } - - /** - * @return CAdminPanel - */ - public function &GetAp() - { - return $this->oAdminPanel; - } -} - -class ap_CoreModuleHelper -{ - /** - * @var CAdminPanel - */ - protected $oAdminPanel; - - /** - * @var ap_Module - */ - protected $oModule; - - /** - * @var api_Settings - */ - protected $oSettings; - - /** - * @var string - */ - public $LastError; - - /** - * @var string - */ - public $LastMessage; - - /** - * @var string - */ - public $Ref; - - /** - * @param ap_Module $oModule - */ - public function __construct(ap_Module &$oModule) - { - $this->oModule =& $oModule; - $this->oAdminPanel =& $oModule->GetAp(); - - $this->oSettings =& CApi::GetSettings(); - - $this->LastError = ''; - $this->LastMessage = ''; - $this->Ref = ''; - } - - /** - * @return bool - */ - protected function saveSettingsXmlWithMessage() - { - return $this->checkBolleanWithMessage($this->oSettings->SaveToXml()); - } - - /** - * @param bool $bValue - * @return bool - */ - protected function checkBolleanWithMessage($bValue) - { - if ($bValue) - { - $this->LastMessage = AP_LANG_SAVESUCCESSFUL; - } - else - { - $this->LastError = AP_LANG_SAVEUNSUCCESSFUL; - } - - return $bValue; - } - - /** - * @param bool $bValue - */ - protected function checkBolleanDeleteWithMessage($bValue) - { - if ($bValue) - { - $this->LastMessage = AP_LANG_DELETE_SUCCESSFUL; - } - else - { - $this->LastError = AP_LANG_DELETE_UNSUCCESSFUL; - } - } - - /** - * @return bool - */ - protected function isStandartSubmit() - { - return isset($_POST['submit_btn']); - } -} + */ + +abstract class ap_Module +{ + /** + * @var array + */ + protected $aTabs; + + /** + * @var string + */ + protected $sPath; + + /** + * @var string + */ + protected $sWebModulePath; + + /** + * @var CAdminPanel + */ + protected $oAdminPanel; + + /** + * @var ap_CoreModuleHelper + */ + protected $oPopulateData; + + /** + * @var ap_CoreModuleHelper + */ + protected $oStandardPostAction; + + /** + * @var ap_CoreModuleHelper + */ + protected $oTableAjaxAction; + + /** + * @var ap_CoreModuleHelper + */ + protected $oStandardPopAction; + + /** + * @var ap_CoreModuleHelper + */ + protected $oBlankAction; + + /** + * @var ap_CoreModuleHelper + */ + protected $oTableList; + + /** + * @var array + */ + protected $aQueryActions; + + /** + * @var int + */ + protected $lastErrorCode; + + /** + * @var string + */ + protected $lastErrorMessage; + + /** + * @param CAdminPanel $oAdminPanel + * @param string $sPath + * @return ap_Module + */ + public function __construct(CAdminPanel &$oAdminPanel, $sPath) + { + $this->aTabs = array(); + $this->aQueryActions = array(); + + $this->oAdminPanel =& $oAdminPanel; + $this->sPath = $sPath; + $this->sWebModulePath = 'modules/'.basename($sPath); + + $this->lastErrorCode = 0; + $this->lastErrorMessage = ''; + + $this->initInclude(); + + $this->oPopulateData = null; + $this->oStandardPostAction = null; + $this->oStandardPopAction = null; + $this->oTableAjaxAction = null; + + $this->oTableList = null; + } + + /** + * @return int + */ + public function getLastErrorCode() + { + return $this->lastErrorCode; + } + + /** + * @return string + */ + public function GetLastErrorMessage() + { + return $this->lastErrorMessage; + } + + /** + * @param string $sTab + * @return bool + */ + public function IsInTab($sTab) + { + return in_array($sTab, $this->aTabs); + } + + /** + * @param string $sTab + * @return bool + */ + public function PType() + { + return $this->oAdminPanel->PType(); + } + + /** + * @param string $sInitType + * @param ap_Screen $oScreen + * @return bool + */ + public function InitScreen($sInitType, ap_Screen &$oScreen) + { + $sTab = $this->oAdminPanel->Tab(); + if ($oScreen instanceof ap_Standard_Screen) + { + if ('first' === $sInitType) + { + $this->initStandardMenuByTab($sTab, $oScreen); + } + else if ('second' === $sInitType) + { + $this->initStandardMainByTab($sTab, $oScreen); + } + else if ('third' === $sInitType) + { + # + } + } + else if ($oScreen instanceof ap_Table_Screen) + { + if ('first' === $sInitType) + { + $this->initTableListFilter($sTab, $oScreen); + $this->initTableTopMenu($sTab, $oScreen); + $this->initTableListHeaders($sTab, $oScreen); + $this->initTableMainSwitchersPre($sTab, $oScreen); + } + else if ('second' === $sInitType) + { + $this->initTableList($sTab, $oScreen); + $this->initTableMainSwitchers($sTab, $oScreen); + $this->initTableMainPopulateData($sTab, $oScreen); + } + else if ('third' === $sInitType) + { + $this->initTableMainSwitchersPost($sTab, $oScreen); + } + } + } + + /** + * @param string $sTab + * @param ap_Screen $oScreen + */ + protected function initTableTopMenu($sTab, ap_Screen &$oScreen) {} + + /** + * @param string $sTab + * @param ap_Screen $oScreen + */ + protected function initTableListHeaders($sTab, ap_Screen &$oScreen) {} + + /** + * @param string $sTab + * @param ap_Screen $oScreen + */ + protected function initTableList($sTab, ap_Screen &$oScreen) {} + + /** + * @param string $sTab + * @param ap_Screen $oScreen + */ + protected function initTableListFilter($sTab, ap_Screen &$oScreen) {} + + /** + * @param string $sTab + * @param ap_Screen $oScreen + */ + protected function initTableMainSwitchers($sTab, ap_Screen &$oScreen) {} + + /** + * @param string $sTab + * @param ap_Screen $oScreen + */ + protected function initTableMainSwitchersPre($sTab, ap_Screen &$oScreen) {} + + /** + * @param string $sTab + * @param ap_Screen $oScreen + */ + protected function initTableMainSwitchersPost($sTab, ap_Screen &$oScreen) {} + + /** + * @param string $sTab + * @param string $sMode + * @param ap_Screen $oScreen + */ + protected function initTableMainPopulateData($sTab, ap_Screen &$oScreen) + { + if ($this->oPopulateData && $this->IsInTab($sTab)) + { + $sTabMode = ucfirst($sTab).'Main'.ucfirst($this->getQueryAction()); + + $oScreen->Data->SetValue('sysTab', $sTab); + $oScreen->Data->SetValue('sysQueryAction', $this->getQueryAction()); + + CApi::Log('call '.get_class($this).'->PopulateData->'.$sTabMode.'()'); + if (method_exists($this->oPopulateData, $sTabMode)) + { + $this->oPopulateData->{$sTabMode}($oScreen); + } + } + } + + /** + * @return string + */ + protected function getQueryAction() + { + $sResult = ''; + foreach ($this->aQueryActions as $sKey) + { + if (isset($_GET[$sKey])) + { + $sResult = $sKey; + break; + } + } + return $sResult; + } + + /** + * @param string $sTab + * @param ap_Screen $oScreen + */ + protected function initStandardMenuByTab($sTab, ap_Screen &$oScreen) {} + + /** + * @param string $sTab + * @param string $sMode + * @param ap_Screen $oScreen + */ + protected function initStandardMainByTab($sTab, ap_Screen &$oScreen) + { + if ($this->oPopulateData && $this->IsInTab($sTab)) + { + $sMode = $oScreen->GetCurrentMode(); + $sTabMode = ucfirst($sTab).ucfirst($sMode); + + CApi::Log('call '.get_class($this).'->PopulateData->'.$sTabMode.'()'); + if (method_exists($this->oPopulateData, $sTabMode)) + { + $oScreen->Data->SetValue('sysTab', $sTab); + $oScreen->Data->SetValue('sysMode', $sMode); + + $this->oPopulateData->{$sTabMode}($oScreen); + } + } + } + + /** + * @return string + */ + public function InitPostAction($sTab) + { + $sResult = false; + if ($this->oStandardPostAction && $this->IsInTab($sTab) && $this->oAdminPanel->IsAuth() && !$this->oAdminPanel->IsOnlyReadAuthType()) + { + $sResult = '?root'; + $sPostId = CPost::get('form_id', 'null'); + $sPostActionFunction = ucfirst($sTab).ucfirst($sPostId); + $sPostActionFunction .= ('collection' === $sPostId && null !== CPost::get('action', null)) + ? ucfirst(CPost::get('action', '')) : ''; + + CApi::Log('call '.get_class($this).'->StandardPostAction->'.$sPostActionFunction.'()'); + if (!empty($sPostId) && method_exists($this->oStandardPostAction, $sPostActionFunction)) + { + $sActionResult = $this->oStandardPostAction->$sPostActionFunction(); + if (!empty($this->oStandardPostAction->LastError)) + { + $this->oAdminPanel->ShowError($this->oStandardPostAction->LastError); + } + else if (!empty($this->oStandardPostAction->LastMessage)) + { + $this->oAdminPanel->ShowMessage($this->oStandardPostAction->LastMessage); + } + + if (empty($sActionResult)) + { + $sResult = $sActionResult; + } + } + } + return $sResult; + } + + /** + * @return void + */ + public function InitPopAction($sTab) + { + if ($this->oStandardPostAction && $this->IsInTab($sTab)) + { + $sPopActionFunction = ucfirst($sTab); + + CApi::Log('call '.get_class($this).'->StandardPopAction->'.$sPopActionFunction.'()'); + if (method_exists($this->oStandardPopAction, $sPopActionFunction)) + { + $this->oStandardPopAction->$sPopActionFunction(); + } + } + } + + /** + * @return void + */ + public function initBlankAction($sTab) + { + if ($this->oBlankAction && $this->IsInTab($sTab)) + { + $sType = isset($_GET['type']) ? $_GET['type'] : null; + $sBlankActionFunction = ucfirst($sTab).ucfirst($sType); + + CApi::Log('call '.get_class($this).'->BlankAction->'.$sBlankActionFunction.'()'); + if (method_exists($this->oBlankAction, $sBlankActionFunction)) + { + $this->oBlankAction->$sBlankActionFunction(); + } + } + } + + /** + * @return void + */ + public function InitAjaxAction($sPostName, $sTab, &$sMessage, &$sError, &$sRef) + { + if ($this->oTableAjaxAction && $this->IsInTab($sTab)) + { + $sQueryAction = CPost::get('QueryAction', ''); + + $sAjaxActionFunction = ucfirst($sTab).ucfirst($sQueryAction). + ((empty($sPostName)) ? '' : '_'.$sPostName); + + if (method_exists($this->oTableAjaxAction, $sAjaxActionFunction)) + { + CApi::Log('call '.get_class($this).'->TableAjaxAction->'.$sAjaxActionFunction.'()'); + $this->oTableAjaxAction->$sAjaxActionFunction(); + + if (!empty($this->oTableAjaxAction->LastError)) + { + $sError = $this->oTableAjaxAction->LastError; + } + else if (!empty($this->oTableAjaxAction->LastMessage)) + { + $sMessage = $this->oTableAjaxAction->LastMessage; + } + + if (!empty($this->oTableAjaxAction->Ref)) + { + $sRef = $this->oTableAjaxAction->Ref; + } + + if (!empty($sError)) + { + CApi::Log('function '.$sAjaxActionFunction.'() return $sError = '.$sError, ELogLevel::Error); + } + } + } + } + + /** + * @return void + */ + abstract protected function initInclude(); + + /** + * @param string $sCssFile + */ + public function CssAddFile($sCssFile) + { + $this->oAdminPanel->CssAddFile($this->WebModulePath().'/js/'.$sCssFile); + } + + /** + * @param string $sJsFile + */ + public function JsAddFile($sJsFile) + { + $this->oAdminPanel->JsAddFile($this->WebModulePath().'/js/'.$sJsFile); + } + + /** + * @param string $sJsFile + */ + public function JsAddVar($sName, $sValue) + { + $this->oAdminPanel->JsAddVar($sName, $sValue); + } + + /** + * @return string + */ + public function WebModulePath() + { + return $this->sWebModulePath; + } + + /** + * @return CAdminPanel + */ + public function &GetAp() + { + return $this->oAdminPanel; + } +} + +class ap_CoreModuleHelper +{ + /** + * @var CAdminPanel + */ + protected $oAdminPanel; + + /** + * @var ap_Module + */ + protected $oModule; + + /** + * @var api_Settings + */ + protected $oSettings; + + /** + * @var string + */ + public $LastError; + + /** + * @var string + */ + public $LastMessage; + + /** + * @var string + */ + public $Ref; + + /** + * @param ap_Module $oModule + */ + public function __construct(ap_Module &$oModule) + { + $this->oModule =& $oModule; + $this->oAdminPanel =& $oModule->GetAp(); + + $this->oSettings =& CApi::GetSettings(); + + $this->LastError = ''; + $this->LastMessage = ''; + $this->Ref = ''; + } + + /** + * @return bool + */ + protected function saveSettingsXmlWithMessage() + { + return $this->checkBolleanWithMessage($this->oSettings->SaveToXml()); + } + + /** + * @param bool $bValue + * @return bool + */ + protected function checkBolleanWithMessage($bValue) + { + if ($bValue) + { + $this->LastMessage = AP_LANG_SAVESUCCESSFUL; + } + else + { + $this->LastError = AP_LANG_SAVEUNSUCCESSFUL; + } + + return $bValue; + } + + /** + * @param bool $bValue + */ + protected function checkBolleanDeleteWithMessage($bValue) + { + if ($bValue) + { + $this->LastMessage = AP_LANG_DELETE_SUCCESSFUL; + } + else + { + $this->LastError = AP_LANG_DELETE_UNSUCCESSFUL; + } + } + + /** + * @return bool + */ + protected function isStandartSubmit() + { + return isset($_POST['submit_btn']); + } +} diff --git a/adminpanel/core/screens/login.php b/adminpanel/core/screens/login.php index ba268b55..655e4653 100644 --- a/adminpanel/core/screens/login.php +++ b/adminpanel/core/screens/login.php @@ -1,54 +1,54 @@ -Data->SetValue('LoginErrorDesc', ''); - } - - $this->JsAddInitText('$(\'#loginId\').focus();'); - $this->CssAddFile('static/styles/screens/login.css'); - - $this->Data->SetValue('AdminLogin', CApi::GetConf('demo.adminpanel.login', '')); - $this->Data->SetValue('AdminPassword', CApi::GetConf('demo.adminpanel.password', '')); - - if (CApi::GetConf('demo.adminpanel.enable', false)) - { - $this->Data->SetValue('LoginDemoFooter', '
-
-This is a demo version of administrative interface.
For WebMail demo interface, click here. -
-
'); - } - } -} + */ + +class ap_Login_Screen extends ap_Simple_Screen +{ + /** + * @param CAdminPanel $oAdminPanel + * @return ap_Login_Screen + */ + public function __construct(CAdminPanel &$oAdminPanel) + { + parent::__construct($oAdminPanel, 'login.php'); + + $sError = ''; + if (isset($_GET['auth_error'])) + { + $sError = AP_LANG_LOGIN_AUTH_ERROR; + } + else if (isset($_GET['sess_error'])) + { + $sError = AP_LANG_LOGIN_SESS_ERROR; + } + else if (isset($_GET['access_error'])) + { + $sError = AP_LANG_LOGIN_ACCESS_ERROR; + } + + if (0 < strlen($sError)) + { + $this->Data->SetValue('LoginErrorDesc', ''); + } + + $this->JsAddInitText('$(\'#loginId\').focus();'); + $this->CssAddFile('static/styles/screens/login.css'); + + $this->Data->SetValue('AdminLogin', CApi::GetConf('demo.adminpanel.login', '')); + $this->Data->SetValue('AdminPassword', CApi::GetConf('demo.adminpanel.password', '')); + + if (CApi::GetConf('demo.adminpanel.enable', false)) + { + $this->Data->SetValue('LoginDemoFooter', '
+
+This is a demo version of administrative interface.
For WebMail demo interface, click here. +
+
'); + } + } +} diff --git a/adminpanel/core/screens/simple.php b/adminpanel/core/screens/simple.php index 451ac607..4f91e86e 100644 --- a/adminpanel/core/screens/simple.php +++ b/adminpanel/core/screens/simple.php @@ -1,25 +1,25 @@ - $sText) - { - $this->Data->SetValue($sKey, $sText); - } - } -} + */ + +class ap_Simple_Screen extends ap_Screen +{ + /** + * @param CAdminPanel $oAdminPanel + * @return ap_Simple_Screen + */ + public function __construct(CAdminPanel &$oAdminPanel, $sGlobalTemplateName, $aData = array()) + { + parent::__construct($oAdminPanel, CAdminPanel::RootPath().'core/templates/'.$sGlobalTemplateName); + + foreach ($aData as $sKey => $sText) + { + $this->Data->SetValue($sKey, $sText); + } + } +} diff --git a/adminpanel/core/templates/error.php b/adminpanel/core/templates/error.php index dcdf1e44..1562391a 100644 --- a/adminpanel/core/templates/error.php +++ b/adminpanel/core/templates/error.php @@ -1,26 +1,26 @@ - - - - - - - - - - - - +
-
- Data->PrintClearValue('ErrorDesc'); - ?> -
-
 
-
 
-
-
 
-
 
-
-
 
-
+ + + + + + + + + + +
+
+ Data->PrintClearValue('ErrorDesc'); + ?> +
+
 
+
 
+
+
 
+
 
+
+
 
+
\ No newline at end of file diff --git a/adminpanel/core/templates/login-warning.php b/adminpanel/core/templates/login-warning.php index 8bf8c33c..b36a6c5d 100644 --- a/adminpanel/core/templates/login-warning.php +++ b/adminpanel/core/templates/login-warning.php @@ -1,3 +1,3 @@ -
- Data->PrintValue('TxtDesc'); ?> +
+ Data->PrintValue('TxtDesc'); ?>
\ No newline at end of file diff --git a/adminpanel/core/templates/login.php b/adminpanel/core/templates/login.php index 8b3a64f6..bda6724d 100644 --- a/adminpanel/core/templates/login.php +++ b/adminpanel/core/templates/login.php @@ -1,48 +1,48 @@ -
- +
+
\ No newline at end of file diff --git a/adminpanel/core/templates/main.php b/adminpanel/core/templates/main.php index bc392c9f..d2668526 100644 --- a/adminpanel/core/templates/main.php +++ b/adminpanel/core/templates/main.php @@ -1,35 +1,35 @@ - - - - - <?php $this->Title(); ?> - - IncludeCss(); ?> - - - -
-IncludeScreen(); -?> -
-IncludeJsVars(); - $this->IncludeJs(); -?> - + */ + + if (!isset($this)) exit(); + +?> + + + + <?php $this->Title(); ?> + + IncludeCss(); ?> + + + +
+IncludeScreen(); +?> +
+IncludeJsVars(); + $this->IncludeJs(); +?> + \ No newline at end of file diff --git a/adminpanel/core/templates/standard.php b/adminpanel/core/templates/standard.php index c328014b..839dcf23 100644 --- a/adminpanel/core/templates/standard.php +++ b/adminpanel/core/templates/standard.php @@ -1,20 +1,20 @@ -WriteTabs(); ?> - -
-
-
- -WriteMenu(); ?> - -
-
-
- - WriteMain(); ?> - -
-
-
-
-
+WriteTabs(); ?> + +
+
+
+ +WriteMenu(); ?> + +
+
+
+ + WriteMain(); ?> + +
+
+
+
+
\ No newline at end of file diff --git a/adminpanel/core/templates/table-main.php b/adminpanel/core/templates/table-main.php index d2a8e987..6329ef18 100644 --- a/adminpanel/core/templates/table-main.php +++ b/adminpanel/core/templates/table-main.php @@ -1,17 +1,17 @@ -
-
-
-
-
-
-
- X - SwitchersToString(); ?> -
-
-
-
-
-
-
- +
+
+
+
+
+
+
+ X + SwitchersToString(); ?> +
+
+
+
+
+
+
+ diff --git a/adminpanel/core/templates/table.php b/adminpanel/core/templates/table.php index 0a9f5dbb..d6503f95 100644 --- a/adminpanel/core/templates/table.php +++ b/adminpanel/core/templates/table.php @@ -1,41 +1,41 @@ -WriteTabs(); - $this->WriteTopMenu(); -?> - -
-
-
-WriteSearch(); ?> -
- - - -
- - - - - - - -
- - -WriteList(); ?> -
-
-
-
-
-
-WriteCard(); ?> - -
-
-
- -WriteLowToolBar(); ?> - - +WriteTabs(); + $this->WriteTopMenu(); +?> + +
+
+
+WriteSearch(); ?> +
+ + + +
+ + + + + + + +
+ + +WriteList(); ?> +
+
+
+
+
+
+WriteCard(); ?> + +
+
+
+ +WriteLowToolBar(); ?> + +
\ No newline at end of file diff --git a/adminpanel/core/utils.php b/adminpanel/core/utils.php index a4176804..485aaed4 100644 --- a/adminpanel/core/utils.php +++ b/adminpanel/core/utils.php @@ -1,239 +1,239 @@ -', '>', str_replace('<', '<', str_replace('&', '&', $sValue))); - } - - /** - * @param string $sValue - * @return string - */ - public static function DecodeSpecialXmlChars($sValue) - { - return str_replace('&', '&', str_replace('<', '<', str_replace('>', '>', $sValue))); - } - - /** - * @param string $sJsDesc - * @param string $sDeq = null - * @return string - */ - public static function ReBuildStringToJavaScript($sJsDesc, $sDeq = null) - { - $sJsDesc = self::ClearStringValue($sJsDesc, $sDeq); - return str_replace(array("\r", "\n", "\t"), array('\r', '\n', '\t'), trim($sJsDesc)); - } - - /** - * @param string $sDesc - * @param string $sDeq = null - * @return string - */ - public static function ClearStringValue($sDesc, $sDeq = null) - { - $sDesc = str_replace('\\', '\\\\', $sDesc); - if ($sDeq !== null && strlen($sDeq) == 1) - { - $sDesc = str_replace($sDeq, '\\'.$sDeq, $sDesc); - } - return $sDesc; - } - - /** - * @param string $sPath - * @param string $sPrefix = null - * @return string - */ - public static function GetFullPath($sPath, $sPrefix = null) - { - if ($sPrefix !== null && !@is_dir(realpath($sPath))) - { - if (!self::IsFullPath($sPath)) - { - $sPath = $sPrefix.'/'.$sPath; - } - } - - if (@is_dir($sPath)) - { - $sPath = rtrim(str_replace('\\', '/', realpath($sPath)), '/'); - } - - return $sPath; - } - - /** - * @param string $sPpath - * @return bool - */ - public static function IsFullPath($sPpath) - { - if (strlen($sPpath) > 0) - { - return (($sPpath{0} == '/' || $sPpath{0} == '\\') || (strlen($sPpath) > 1 && self::IsWin() && $sPpath{1} == ':')); - } - return false; - } - - /** - * @return bool - */ - public static function IsWin() - { - return ('WIN' === strtoupper(substr(PHP_OS, 0, 3))); - } - - /** - * @param array $aArray - * @param string $sType - * @return array - */ - public static function SetTypeArrayValue($aArray, $sType) - { - $aResult = array(); - foreach ($aArray as $mValue) - { - settype($mValue, $sType); - $aResult[] =$mValue; - } - return $aResult; - } - - /** - * @param string $sPrefix - * @return string - */ - public static function ClearPrefix($sPrefix) - { - $sNewPrefix = preg_replace('/[^a-z0-9_]/i', '_', $sPrefix); - if ($sNewPrefix !== $sPrefix) - { - $sNewPrefix = preg_replace('/[_]+/', '_', $sNewPrefix); - } - return $sNewPrefix; - } - - /** - * @staticvar array $aMapping - * @param int $iCodePage - * @return string - */ - public static function GetCodePageName($iCodePage) - { - static $aMapping = array( - 0 => 'default', - 51936 => 'euc-cn', - 936 => 'gb2312', - 950 => 'big5', - 946 => 'euc-kr', - 50225 => 'iso-2022-kr', - 50220 => 'iso-2022-jp', - 932 => 'shift-jis', - 65000 => 'utf-7', - 65001 => 'utf-8', - 1250 => 'windows-1250', - 1251 => 'windows-1251', - 1252 => 'windows-1252', - 1253 => 'windows-1253', - 1254 => 'windows-1254', - 1255 => 'windows-1255', - 1256 => 'windows-1256', - 1257 => 'windows-1257', - 1258 => 'windows-1258', - 20866 => 'koi8-r', - 28591 => 'iso-8859-1', - 28592 => 'iso-8859-2', - 28593 => 'iso-8859-3', - 28594 => 'iso-8859-4', - 28595 => 'iso-8859-5', - 28596 => 'iso-8859-6', - 28597 => 'iso-8859-7', - 28598 => 'iso-8859-8' - ); - - return (isset($aMapping[$iCodePage])) ? $aMapping[$iCodePage] : ''; - } - - /** - * @staticvar array $aMapping - * @param string $sCodePageName - * @return int - */ - public static function GetCodePageNumber($sCodePageName) - { - static $aMapping = array( - 'default' => 0, - 'euc-cn' => 51936, - 'gb2312' => 936, - 'big5' => 950, - 'euc-kr' => 949, - 'iso-2022-kr' => 50225, - 'iso-2022-jp' => 50220, - 'shift-jis' => 932, - 'utf-7' => 65000, - 'utf-8' => 65001, - 'windows-1250' => 1250, - 'windows-1251' => 1251, - 'windows-1252' => 1252, - 'windows-1253' => 1253, - 'windows-1254' => 1254, - 'windows-1255' => 1255, - 'windows-1256' => 1256, - 'windows-1257' => 1257, - 'windows-1258' => 1258, - 'koi8-r' => 20866, - 'iso-8859-1' => 28591, - 'iso-8859-2' => 28592, - 'iso-8859-3' => 28593, - 'iso-8859-4' => 28594, - 'iso-8859-5' => 28595, - 'iso-8859-6' => 28596, - 'iso-8859-7' => 28597, - 'iso-8859-8' => 28598 - ); - - return (isset($aMapping[$sCodePageName])) ? $aMapping[$sCodePageName] : 0; - } - } + */ + + class ap_Utils + { + /** + * @return float + */ + public static function Microtime() + { + return microtime(true); + } + + /** + * @param array $aArray + * @param string $sKey + * @param mixed $mDefault + * @return mixed + */ + public static function ArrayValue($aArray, $sKey, $mDefault) + { + return (isset($aArray[$sKey])) ? $aArray[$sKey] : $mDefault; + } + + /** + * @param string $sValue + * @return string + */ + public static function AttributeQuote($sValue) + { + return str_replace('\'', ''', str_replace('"', '"', $sValue)); + } + + /** + * @param string $sValue + * @return string + */ + public static function EncodeSpecialXmlChars($sValue) + { + return str_replace('>', '>', str_replace('<', '<', str_replace('&', '&', $sValue))); + } + + /** + * @param string $sValue + * @return string + */ + public static function DecodeSpecialXmlChars($sValue) + { + return str_replace('&', '&', str_replace('<', '<', str_replace('>', '>', $sValue))); + } + + /** + * @param string $sJsDesc + * @param string $sDeq = null + * @return string + */ + public static function ReBuildStringToJavaScript($sJsDesc, $sDeq = null) + { + $sJsDesc = self::ClearStringValue($sJsDesc, $sDeq); + return str_replace(array("\r", "\n", "\t"), array('\r', '\n', '\t'), trim($sJsDesc)); + } + + /** + * @param string $sDesc + * @param string $sDeq = null + * @return string + */ + public static function ClearStringValue($sDesc, $sDeq = null) + { + $sDesc = str_replace('\\', '\\\\', $sDesc); + if ($sDeq !== null && strlen($sDeq) == 1) + { + $sDesc = str_replace($sDeq, '\\'.$sDeq, $sDesc); + } + return $sDesc; + } + + /** + * @param string $sPath + * @param string $sPrefix = null + * @return string + */ + public static function GetFullPath($sPath, $sPrefix = null) + { + if ($sPrefix !== null && !@is_dir(realpath($sPath))) + { + if (!self::IsFullPath($sPath)) + { + $sPath = $sPrefix.'/'.$sPath; + } + } + + if (@is_dir($sPath)) + { + $sPath = rtrim(str_replace('\\', '/', realpath($sPath)), '/'); + } + + return $sPath; + } + + /** + * @param string $sPpath + * @return bool + */ + public static function IsFullPath($sPpath) + { + if (strlen($sPpath) > 0) + { + return (($sPpath{0} == '/' || $sPpath{0} == '\\') || (strlen($sPpath) > 1 && self::IsWin() && $sPpath{1} == ':')); + } + return false; + } + + /** + * @return bool + */ + public static function IsWin() + { + return ('WIN' === strtoupper(substr(PHP_OS, 0, 3))); + } + + /** + * @param array $aArray + * @param string $sType + * @return array + */ + public static function SetTypeArrayValue($aArray, $sType) + { + $aResult = array(); + foreach ($aArray as $mValue) + { + settype($mValue, $sType); + $aResult[] =$mValue; + } + return $aResult; + } + + /** + * @param string $sPrefix + * @return string + */ + public static function ClearPrefix($sPrefix) + { + $sNewPrefix = preg_replace('/[^a-z0-9_]/i', '_', $sPrefix); + if ($sNewPrefix !== $sPrefix) + { + $sNewPrefix = preg_replace('/[_]+/', '_', $sNewPrefix); + } + return $sNewPrefix; + } + + /** + * @staticvar array $aMapping + * @param int $iCodePage + * @return string + */ + public static function GetCodePageName($iCodePage) + { + static $aMapping = array( + 0 => 'default', + 51936 => 'euc-cn', + 936 => 'gb2312', + 950 => 'big5', + 946 => 'euc-kr', + 50225 => 'iso-2022-kr', + 50220 => 'iso-2022-jp', + 932 => 'shift-jis', + 65000 => 'utf-7', + 65001 => 'utf-8', + 1250 => 'windows-1250', + 1251 => 'windows-1251', + 1252 => 'windows-1252', + 1253 => 'windows-1253', + 1254 => 'windows-1254', + 1255 => 'windows-1255', + 1256 => 'windows-1256', + 1257 => 'windows-1257', + 1258 => 'windows-1258', + 20866 => 'koi8-r', + 28591 => 'iso-8859-1', + 28592 => 'iso-8859-2', + 28593 => 'iso-8859-3', + 28594 => 'iso-8859-4', + 28595 => 'iso-8859-5', + 28596 => 'iso-8859-6', + 28597 => 'iso-8859-7', + 28598 => 'iso-8859-8' + ); + + return (isset($aMapping[$iCodePage])) ? $aMapping[$iCodePage] : ''; + } + + /** + * @staticvar array $aMapping + * @param string $sCodePageName + * @return int + */ + public static function GetCodePageNumber($sCodePageName) + { + static $aMapping = array( + 'default' => 0, + 'euc-cn' => 51936, + 'gb2312' => 936, + 'big5' => 950, + 'euc-kr' => 949, + 'iso-2022-kr' => 50225, + 'iso-2022-jp' => 50220, + 'shift-jis' => 932, + 'utf-7' => 65000, + 'utf-8' => 65001, + 'windows-1250' => 1250, + 'windows-1251' => 1251, + 'windows-1252' => 1252, + 'windows-1253' => 1253, + 'windows-1254' => 1254, + 'windows-1255' => 1255, + 'windows-1256' => 1256, + 'windows-1257' => 1257, + 'windows-1258' => 1258, + 'koi8-r' => 20866, + 'iso-8859-1' => 28591, + 'iso-8859-2' => 28592, + 'iso-8859-3' => 28593, + 'iso-8859-4' => 28594, + 'iso-8859-5' => 28595, + 'iso-8859-6' => 28596, + 'iso-8859-7' => 28597, + 'iso-8859-8' => 28598 + ); + + return (isset($aMapping[$sCodePageName])) ? $aMapping[$sCodePageName] : 0; + } + } diff --git a/adminpanel/index.php b/adminpanel/index.php index 38d49164..c3352054 100644 --- a/adminpanel/index.php +++ b/adminpanel/index.php @@ -1,13 +1,13 @@ -Run()->End(); \ No newline at end of file diff --git a/adminpanel/modules/common/inc/constants.php b/adminpanel/modules/common/inc/constants.php index 93fce936..bf1b6f2d 100644 --- a/adminpanel/modules/common/inc/constants.php +++ b/adminpanel/modules/common/inc/constants.php @@ -49,7 +49,6 @@ define('CM_SWITCHER_MODE_EDIT_USER_GENERAL_NAME', CApi::I18N('ADMIN_PANEL/EDIT_USERS_GENERAL_NAME')); define('CM_SWITCHER_MODE_EDIT_USER_SIP_NAME', CApi::I18N('ADMIN_PANEL/EDIT_USERS_SIP_NAME')); define('CM_SWITCHER_MODE_EDIT_USER_TWILIO_NAME', CApi::I18N('ADMIN_PANEL/EDIT_USERS_TWILIO_NAME')); - define('CM_SWITCHER_MODE_EDIT_USER_SOCIAL_NAME', CApi::I18N('ADMIN_PANEL/EDIT_USERS_SOCIAL_NAME')); define('CM_LANG_NODOMAINS', CApi::I18N('ADMIN_PANEL/INFO_NODOMAINS')); define('CM_LANG_NODOMAINS_RESULTEMPTY', CApi::I18N('ADMIN_PANEL/INFO_DOMAINS_NOT_FOUND')); define('CM_LANG_NOUSERSINDOMAIN', CApi::I18N('ADMIN_PANEL/INFO_NOUSERS')); diff --git a/adminpanel/modules/common/inc/populate.php b/adminpanel/modules/common/inc/populate.php index a2378ec1..0d179d19 100644 --- a/adminpanel/modules/common/inc/populate.php +++ b/adminpanel/modules/common/inc/populate.php @@ -1,168 +1,168 @@ -Data->SetValue('classSqlTypeVisibility', 'wm_hide'); - $oScreen->Data->SetValue('radioSqlTypeMySQL', true); - } - else - { - $oScreen->Data->SetValue('radioSqlTypeMySQL', EDbType::MySQL === $this->oSettings->GetConf('Common/DBType')); - $oScreen->Data->SetValue('radioSqlTypePostgreSQL', EDbType::PostgreSQL === $this->oSettings->GetConf('Common/DBType')); - } - - $oScreen->Data->SetValue('txtSqlLogin', $this->oSettings->GetConf('Common/DBLogin')); - if (0 < strlen($this->oSettings->GetConf('Common/DBLogin'))) - { - $oScreen->Data->SetValue('txtSqlPassword', AP_DUMMYPASSWORD); - } - - $oScreen->Data->SetValue('txtSqlName', $this->oSettings->GetConf('Common/DBName')); - $oScreen->Data->SetValue('txtSqlSrc', $this->oSettings->GetConf('Common/DBHost')); - $oScreen->Data->SetValue('txtToken', CApi::getCsrfToken('p7admToken')); - - $this->oModule->JsAddFile('db.js'); - } - - public function SystemSecurity(ap_Standard_Screen &$oScreen) - { - $oScreen->Data->SetValue('txtUserName', $this->oSettings->GetConf('Common/AdminLogin')); - $oScreen->Data->SetValue('txtOldPassword', AP_DUMMYPASSWORD); - $oScreen->Data->SetValue('txtToken', CApi::getCsrfToken('p7admToken')); - $oScreen->Data->SetValue('txtNewPassword', AP_DUMMYPASSWORD); - $oScreen->Data->SetValue('txtConfirmNewPassword', AP_DUMMYPASSWORD); - } - - public function CommonSocial(ap_Standard_Screen &$oScreen) - { - $oApiCapa = CApi::Manager('capability'); - /* @var $oApiCapa CApiCapabilityManager */ - - if ($oApiCapa && !$this->oAdminPanel->IsOnlyReadAuthType()) - { - $oTenant = /* @var $oTenant CTenant */ $this->oModule->GetTenantAdminObject(); - if ($oTenant) - { - $aConnectors = array(); - $oPlugin = \CApi::Plugin()->GetPluginByName('external-services'); - if ($oPlugin) - { - $aEnableConnectors = $oPlugin->GetEnabledConnectors(); - $aSocials = $oTenant->getSocials(); - - foreach($aSocials as $sKey => $oSocial) - { - if (in_array($sKey, $aEnableConnectors)) - { - - $oSocial->SupportedScopes = $oPlugin->GetSupportedScopes($sKey); - $oSocial->TranslatedScopes = $oPlugin->GetTranslatedScopes($oSocial->SupportedScopes); - $oSocial->HasApiKey = $oPlugin->HasApiKey($sKey); - $aConnectors[$sKey] = $oSocial; - } - } - } - - $oScreen->Data->SetValue('Socials', $aConnectors); - } - } - } - - public function DomainsMainEdit(ap_Table_Screen &$oScreen) - { - $sDomainSkin = $sDomainLang = $sDomainZone = ''; - - /* @var $oDomain CDomain */ - $oDomain =& $this->oAdminPanel->GetMainObject('domain_edit'); - if ($oDomain) - { - $oScreen->Data->SetValue('hiddenDomainId', $oDomain->IdDomain); - - $oScreen->Data->SetValue('classHideDefault', $oDomain->IsDefaultDomain ? 'wm_hide' : ''); - $oScreen->Data->SetValue('classHideNotDefault', $oDomain->IsDefaultDomain ? '' : 'wm_hide'); - $oScreen->Data->SetValue('classHideOverrideSettings', 0 < $oDomain->IdTenant ? 'wm_hide' : ''); - $oScreen->Data->SetValue('classHideSsl', $this->oModule->hasSslSupport() ? '' : 'wm_hide'); - $oScreen->Data->SetValue('chOverrideSettings', $oDomain->OverrideSettings); - - $sDomainSkin = $oDomain->DefaultSkin; - $sDomainLang = $oDomain->DefaultLanguage; - $sDomainZone = $oDomain->DefaultTimeZone; - $sDefaultTab = $oDomain->DefaultTab; - - $oScreen->Data->SetValue('txtSiteName', $oDomain->SiteName); - - $oScreen->Data->SetValue('radioTimeFormat12', ETimeFormat::F12 === $oDomain->DefaultTimeFormat); - $oScreen->Data->SetValue('radioTimeFormat24', ETimeFormat::F24 === $oDomain->DefaultTimeFormat); - - $oScreen->Data->SetValue('optDateFormatDDMonthYYYY', EDateFormat::DD_MONTH_YYYY === $oDomain->DefaultDateFormat); - $oScreen->Data->SetValue('optDateFormatMMDDYY', EDateFormat::MMDDYY === $oDomain->DefaultDateFormat); - $oScreen->Data->SetValue('optDateFormatDDMMYY', EDateFormat::DDMMYY === $oDomain->DefaultDateFormat); - $oScreen->Data->SetValue('optDateFormatMMDDYYYY', EDateFormat::MMDDYYYY === $oDomain->DefaultDateFormat); - $oScreen->Data->SetValue('optDateFormatDDMMYYYY', EDateFormat::DDMMYYYY === $oDomain->DefaultDateFormat); - } - - $sSkinsOptions = ''; - $aSkins = $this->oModule->GetSkinList(); - if (is_array($aSkins)) - { - foreach ($aSkins as $sSkin) - { - $sSelected = ($sSkin === $sDomainSkin) ? ' selected="selected"' : ''; - $sSkinsOptions .= ''; - } - $oScreen->Data->SetValue('selSkinsOptions', $sSkinsOptions); - } - - $sTabsOptions = ''; - $aTabs = $this->oModule->getTabList($oDomain); - if (is_array($aTabs)) - { - foreach ($aTabs as $sKeyTab => $sValueTab) - { - $sSelected = ($sKeyTab === $sDefaultTab) ? ' selected="selected"' : ''; - $sTabsOptions .= ''; - } - $oScreen->Data->SetValue('selTabsOptions', $sTabsOptions); - } - - $sLanguageOptions = ''; - $aLangs = $this->oModule->GetLangsList(); - if (is_array($aLangs)) - { - foreach ($aLangs as $sLang) - { - $sSelected = ($sLang === $sDomainLang) ? ' selected="selected"' : ''; - $sLanguageOptions .= ''; - } - - $oScreen->Data->SetValue('selLanguageOptions', $sLanguageOptions); - } - - $sTimeZoneOptions = ''; - $aTimeZones = $this->oModule->GetTimeZoneList(); - if (is_array($aTimeZones)) - { - foreach ($aTimeZones as $iIndex => $aTimeZone) - { - $sSelected = ((int) $sDomainZone === (int) $iIndex) ? ' selected="selected"' : ''; - $sTimeZoneOptions .= ''; - } - $oScreen->Data->SetValue('selTimeZone', $sTimeZoneOptions); - } - } -} + */ + +class CCommonPopulateData extends ap_CoreModuleHelper +{ + public function SystemDb(ap_Standard_Screen &$oScreen) + { + if (CApi::GetConf('mailsuite', false)) + { + $oScreen->Data->SetValue('classSqlTypeVisibility', 'wm_hide'); + $oScreen->Data->SetValue('radioSqlTypeMySQL', true); + } + else + { + $oScreen->Data->SetValue('radioSqlTypeMySQL', EDbType::MySQL === $this->oSettings->GetConf('Common/DBType')); + $oScreen->Data->SetValue('radioSqlTypePostgreSQL', EDbType::PostgreSQL === $this->oSettings->GetConf('Common/DBType')); + } + + $oScreen->Data->SetValue('txtSqlLogin', $this->oSettings->GetConf('Common/DBLogin')); + if (0 < strlen($this->oSettings->GetConf('Common/DBLogin'))) + { + $oScreen->Data->SetValue('txtSqlPassword', AP_DUMMYPASSWORD); + } + + $oScreen->Data->SetValue('txtSqlName', $this->oSettings->GetConf('Common/DBName')); + $oScreen->Data->SetValue('txtSqlSrc', $this->oSettings->GetConf('Common/DBHost')); + $oScreen->Data->SetValue('txtToken', CApi::getCsrfToken('p7admToken')); + + $this->oModule->JsAddFile('db.js'); + } + + public function SystemSecurity(ap_Standard_Screen &$oScreen) + { + $oScreen->Data->SetValue('txtUserName', $this->oSettings->GetConf('Common/AdminLogin')); + $oScreen->Data->SetValue('txtOldPassword', AP_DUMMYPASSWORD); + $oScreen->Data->SetValue('txtToken', CApi::getCsrfToken('p7admToken')); + $oScreen->Data->SetValue('txtNewPassword', AP_DUMMYPASSWORD); + $oScreen->Data->SetValue('txtConfirmNewPassword', AP_DUMMYPASSWORD); + } + + public function CommonSocial(ap_Standard_Screen &$oScreen) + { + $oApiCapa = CApi::Manager('capability'); + /* @var $oApiCapa CApiCapabilityManager */ + + if ($oApiCapa && !$this->oAdminPanel->IsOnlyReadAuthType()) + { + $oTenant = /* @var $oTenant CTenant */ $this->oModule->GetTenantAdminObject(); + if ($oTenant) + { + $aConnectors = array(); + $oPlugin = \CApi::Plugin()->GetPluginByName('external-services'); + if ($oPlugin) + { + $aEnableConnectors = $oPlugin->GetEnabledConnectors(); + $aSocials = $oTenant->getSocials(); + + foreach($aSocials as $sKey => $oSocial) + { + if (in_array($sKey, $aEnableConnectors)) + { + + $oSocial->SupportedScopes = $oPlugin->GetSupportedScopes($sKey); + $oSocial->TranslatedScopes = $oPlugin->GetTranslatedScopes($oSocial->SupportedScopes); + $oSocial->HasApiKey = $oPlugin->HasApiKey($sKey); + $aConnectors[$sKey] = $oSocial; + } + } + } + + $oScreen->Data->SetValue('Socials', $aConnectors); + } + } + } + + public function DomainsMainEdit(ap_Table_Screen &$oScreen) + { + $sDomainSkin = $sDomainLang = $sDomainZone = ''; + + /* @var $oDomain CDomain */ + $oDomain =& $this->oAdminPanel->GetMainObject('domain_edit'); + if ($oDomain) + { + $oScreen->Data->SetValue('hiddenDomainId', $oDomain->IdDomain); + + $oScreen->Data->SetValue('classHideDefault', $oDomain->IsDefaultDomain ? 'wm_hide' : ''); + $oScreen->Data->SetValue('classHideNotDefault', $oDomain->IsDefaultDomain ? '' : 'wm_hide'); + $oScreen->Data->SetValue('classHideOverrideSettings', 0 < $oDomain->IdTenant ? 'wm_hide' : ''); + $oScreen->Data->SetValue('classHideSsl', $this->oModule->hasSslSupport() ? '' : 'wm_hide'); + $oScreen->Data->SetValue('chOverrideSettings', $oDomain->OverrideSettings); + + $sDomainSkin = $oDomain->DefaultSkin; + $sDomainLang = $oDomain->DefaultLanguage; + $sDomainZone = $oDomain->DefaultTimeZone; + $sDefaultTab = $oDomain->DefaultTab; + + $oScreen->Data->SetValue('txtSiteName', $oDomain->SiteName); + + $oScreen->Data->SetValue('radioTimeFormat12', ETimeFormat::F12 === $oDomain->DefaultTimeFormat); + $oScreen->Data->SetValue('radioTimeFormat24', ETimeFormat::F24 === $oDomain->DefaultTimeFormat); + + $oScreen->Data->SetValue('optDateFormatDDMonthYYYY', EDateFormat::DD_MONTH_YYYY === $oDomain->DefaultDateFormat); + $oScreen->Data->SetValue('optDateFormatMMDDYY', EDateFormat::MMDDYY === $oDomain->DefaultDateFormat); + $oScreen->Data->SetValue('optDateFormatDDMMYY', EDateFormat::DDMMYY === $oDomain->DefaultDateFormat); + $oScreen->Data->SetValue('optDateFormatMMDDYYYY', EDateFormat::MMDDYYYY === $oDomain->DefaultDateFormat); + $oScreen->Data->SetValue('optDateFormatDDMMYYYY', EDateFormat::DDMMYYYY === $oDomain->DefaultDateFormat); + } + + $sSkinsOptions = ''; + $aSkins = $this->oModule->GetSkinList(); + if (is_array($aSkins)) + { + foreach ($aSkins as $sSkin) + { + $sSelected = ($sSkin === $sDomainSkin) ? ' selected="selected"' : ''; + $sSkinsOptions .= ''; + } + $oScreen->Data->SetValue('selSkinsOptions', $sSkinsOptions); + } + + $sTabsOptions = ''; + $aTabs = $this->oModule->getTabList($oDomain); + if (is_array($aTabs)) + { + foreach ($aTabs as $sKeyTab => $sValueTab) + { + $sSelected = ($sKeyTab === $sDefaultTab) ? ' selected="selected"' : ''; + $sTabsOptions .= ''; + } + $oScreen->Data->SetValue('selTabsOptions', $sTabsOptions); + } + + $sLanguageOptions = ''; + $aLangs = $this->oModule->GetLangsList(); + if (is_array($aLangs)) + { + foreach ($aLangs as $sLang) + { + $sSelected = ($sLang === $sDomainLang) ? ' selected="selected"' : ''; + $sLanguageOptions .= ''; + } + + $oScreen->Data->SetValue('selLanguageOptions', $sLanguageOptions); + } + + $sTimeZoneOptions = ''; + $aTimeZones = $this->oModule->GetTimeZoneList(); + if (is_array($aTimeZones)) + { + foreach ($aTimeZones as $iIndex => $aTimeZone) + { + $sSelected = ((int) $sDomainZone === (int) $iIndex) ? ' selected="selected"' : ''; + $sTimeZoneOptions .= ''; + } + $oScreen->Data->SetValue('selTimeZone', $sTimeZoneOptions); + } + } +} diff --git a/adminpanel/modules/common/inc/post.php b/adminpanel/modules/common/inc/post.php index fa1fed99..6cb42be1 100644 --- a/adminpanel/modules/common/inc/post.php +++ b/adminpanel/modules/common/inc/post.php @@ -1,157 +1,157 @@ -oSettings->SetConf('Common/DBType', EDbType::MySQL); - } - else - { - $this->oSettings->SetConf('Common/DBType', - EnumConvert::FromPost(CPost::get('radioSqlType'), 'EDbType')); - } - - if (CPost::Has('txtSqlLogin')) - { - $this->oSettings->SetConf('Common/DBLogin', CPost::get('txtSqlLogin')); - } - if (CPost::Has('txtSqlPassword') && - AP_DUMMYPASSWORD !== (string) CPost::get('txtSqlPassword')) - { - $this->oSettings->SetConf('Common/DBPassword', CPost::get('txtSqlPassword')); - } - if (CPost::Has('txtSqlName')) - { - $this->oSettings->SetConf('Common/DBName', CPost::get('txtSqlName')); - } - if (CPost::Has('txtSqlSrc')) - { - $this->oSettings->SetConf('Common/DBHost', CPost::get('txtSqlSrc')); - } - - if (CPost::GetCheckBox('isTestConnection')) - { - CDbCreator::ClearStatic(); - - $aConnections =& CDbCreator::CreateConnector($this->oSettings); - $oConnect = $aConnections[0]; - if ($oConnect) - { - $this->LastError = AP_LANG_CONNECTUNSUCCESSFUL; - try - { - if ($oConnect->Connect()) - { - $this->LastMessage = AP_LANG_CONNECTSUCCESSFUL; - $this->LastError = ''; - } - } - catch (CApiDbException $oException) - { - $this->LastError .= - "\r\n".$oException->getMessage().' ('.((int) $oException->getCode()).')'; - } - } - else - { - $this->LastError = AP_LANG_CONNECTUNSUCCESSFUL; - } - - $this->oSettings->SaveToXml(); - } - else - { - $this->saveSettingsXmlWithMessage(); - } - } - - return ''; - } - - public function SystemSecurity() - { - $bDoSave = true; - if (CApi::getCsrfToken('p7admToken') === CPost::get('txtToken')) - { - if (CPost::Has('txtNewPassword') && CPost::Has('txtConfirmNewPassword')) - { - $oWebmailApi = CApi::Manager('webmail'); - if (!$oWebmailApi->validateAdminPassword(trim(CPost::get('txtOldPassword')))) { - $bDoSave = false; - $this->LastError = CM_PASSWORDS_INVALID_OLD; - } else if ((string)CPost::get('txtNewPassword') !== (string)CPost::get('txtConfirmNewPassword')) { - $bDoSave = false; - $this->LastError = CM_PASSWORDS_NOT_MATCH; - } else if (AP_DUMMYPASSWORD !== (string)CPost::get('txtNewPassword')) { - $this->oSettings->SetConf('Common/AdminPassword', md5(trim(CPost::get('txtNewPassword')))); - } - - if ($bDoSave) { - if (CPost::Has('txtUserName')) { - $this->oSettings->SetConf('Common/AdminLogin', CPost::get('txtUserName')); - } - - $this->saveSettingsXmlWithMessage(); - } - } - } - else - { - $this->LastError = CApi::I18N('API/INVALID_TOKEN'); - } - } - - public function CommonSocial() - { - $oApiCapa = CApi::Manager('capability'); - /* @var $oApiCapa CApiCapabilityManager */ - - if ($oApiCapa) - { - $oTenant = /* @var $oTenant CTenant */ $this->oModule->GetTenantAdminObject(); - if ($oTenant) - { - $aTenentSocials = array(); - foreach ($oTenant->getSocials() as $sKey => $oSocial) - { - $oTenentSocial = new CTenantSocials(); - $oTenentSocial->IdTenant = $oTenant->IdTenant; - $oTenentSocial->SocialAllow = CPost::GetCheckBox($sKey . '_chSocialAllow'); - $oTenentSocial->SocialName = ucfirst($sKey); - $oTenentSocial->SocialId = CPost::get($sKey . '_txtSocialId'); - $oTenentSocial->SocialSecret = CPost::get($sKey . '_txtSocialSecret'); - $oTenentSocial->SocialApiKey = CPost::get($sKey . '_txtSocialApiKey'); - - $aScopes = CPost::get($sKey . '_chSocialScopes', array()); - $oTenentSocial->SocialScopes = implode(' ', array_keys($aScopes)); - - $aTenentSocials[$sKey] = $oTenentSocial; - } - $oTenant->setSocials($aTenentSocials); - } - - if ($oTenant && $this->oModule->UpdateTenantAdminObject($oTenant)) - { - $this->LastMessage = AP_LANG_SAVESUCCESSFUL; - $this->LastError = ''; - } - else - { - $this->LastMessage = ''; - $this->LastError = AP_LANG_SAVEUNSUCCESSFUL; - } - } - } -} + */ + +class CCommonPostAction extends ap_CoreModuleHelper +{ + public function SystemDb() + { + if (CApi::getCsrfToken('p7admToken') === CPost::get('txtToken')) + { + if (CApi::GetConf('mailsuite', false)) + { + $this->oSettings->SetConf('Common/DBType', EDbType::MySQL); + } + else + { + $this->oSettings->SetConf('Common/DBType', + EnumConvert::FromPost(CPost::get('radioSqlType'), 'EDbType')); + } + + if (CPost::Has('txtSqlLogin')) + { + $this->oSettings->SetConf('Common/DBLogin', CPost::get('txtSqlLogin')); + } + if (CPost::Has('txtSqlPassword') && + AP_DUMMYPASSWORD !== (string) CPost::get('txtSqlPassword')) + { + $this->oSettings->SetConf('Common/DBPassword', CPost::get('txtSqlPassword')); + } + if (CPost::Has('txtSqlName')) + { + $this->oSettings->SetConf('Common/DBName', CPost::get('txtSqlName')); + } + if (CPost::Has('txtSqlSrc')) + { + $this->oSettings->SetConf('Common/DBHost', CPost::get('txtSqlSrc')); + } + + if (CPost::GetCheckBox('isTestConnection')) + { + CDbCreator::ClearStatic(); + + $aConnections =& CDbCreator::CreateConnector($this->oSettings); + $oConnect = $aConnections[0]; + if ($oConnect) + { + $this->LastError = AP_LANG_CONNECTUNSUCCESSFUL; + try + { + if ($oConnect->Connect()) + { + $this->LastMessage = AP_LANG_CONNECTSUCCESSFUL; + $this->LastError = ''; + } + } + catch (CApiDbException $oException) + { + $this->LastError .= + "\r\n".$oException->getMessage().' ('.((int) $oException->getCode()).')'; + } + } + else + { + $this->LastError = AP_LANG_CONNECTUNSUCCESSFUL; + } + + $this->oSettings->SaveToXml(); + } + else + { + $this->saveSettingsXmlWithMessage(); + } + } + + return ''; + } + + public function SystemSecurity() + { + $bDoSave = true; + if (CApi::getCsrfToken('p7admToken') === CPost::get('txtToken')) + { + if (CPost::Has('txtNewPassword') && CPost::Has('txtConfirmNewPassword')) + { + $oWebmailApi = CApi::Manager('webmail'); + if (!$oWebmailApi->validateAdminPassword(trim(CPost::get('txtOldPassword')))) { + $bDoSave = false; + $this->LastError = CM_PASSWORDS_INVALID_OLD; + } else if ((string)CPost::get('txtNewPassword') !== (string)CPost::get('txtConfirmNewPassword')) { + $bDoSave = false; + $this->LastError = CM_PASSWORDS_NOT_MATCH; + } else if (AP_DUMMYPASSWORD !== (string)CPost::get('txtNewPassword')) { + $this->oSettings->SetConf('Common/AdminPassword', md5(trim(CPost::get('txtNewPassword')))); + } + + if ($bDoSave) { + if (CPost::Has('txtUserName')) { + $this->oSettings->SetConf('Common/AdminLogin', CPost::get('txtUserName')); + } + + $this->saveSettingsXmlWithMessage(); + } + } + } + else + { + $this->LastError = CApi::I18N('API/INVALID_TOKEN'); + } + } + + public function CommonSocial() + { + $oApiCapa = CApi::Manager('capability'); + /* @var $oApiCapa CApiCapabilityManager */ + + if ($oApiCapa) + { + $oTenant = /* @var $oTenant CTenant */ $this->oModule->GetTenantAdminObject(); + if ($oTenant) + { + $aTenentSocials = array(); + foreach ($oTenant->getSocials() as $sKey => $oSocial) + { + $oTenentSocial = new CTenantSocials(); + $oTenentSocial->IdTenant = $oTenant->IdTenant; + $oTenentSocial->SocialAllow = CPost::GetCheckBox($sKey . '_chSocialAllow'); + $oTenentSocial->SocialName = ucfirst($sKey); + $oTenentSocial->SocialId = CPost::get($sKey . '_txtSocialId'); + $oTenentSocial->SocialSecret = CPost::get($sKey . '_txtSocialSecret'); + $oTenentSocial->SocialApiKey = CPost::get($sKey . '_txtSocialApiKey'); + + $aScopes = CPost::get($sKey . '_chSocialScopes', array()); + $oTenentSocial->SocialScopes = implode(' ', array_keys($aScopes)); + + $aTenentSocials[$sKey] = $oTenentSocial; + } + $oTenant->setSocials($aTenentSocials); + } + + if ($oTenant && $this->oModule->UpdateTenantAdminObject($oTenant)) + { + $this->LastMessage = AP_LANG_SAVESUCCESSFUL; + $this->LastError = ''; + } + else + { + $this->LastMessage = ''; + $this->LastError = AP_LANG_SAVEUNSUCCESSFUL; + } + } + } +} diff --git a/adminpanel/modules/common/index.php b/adminpanel/modules/common/index.php index d510c0e7..0d8002ac 100644 --- a/adminpanel/modules/common/index.php +++ b/adminpanel/modules/common/index.php @@ -1,712 +1,712 @@ -oDomainsApi = CApi::Manager('domains'); - $this->oUsersApi = CApi::Manager('users'); - $this->oCapabilityApi = CApi::Manager('capability'); - $this->oWebmailApi = CApi::Manager('webmail'); - $this->oIntegratorApi = CApi::Manager('integrator'); - $this->oTenantsApi = CApi::Manager('tenants'); - - if (\CApi::GetConf('labs.allow-social-integration', true)) - { - $this->aTabs[] = AP_TAB_COMMON; - } - - $this->aTabs[] = AP_TAB_DOMAINS; - $this->aTabs[] = AP_TAB_SYSTEM; - - $this->aQueryActions[] = 'edit'; - $this->aQueryActions[] = 'list'; - - $this->oPopulateData = new CCommonPopulateData($this); - $this->oStandardPostAction = new CCommonPostAction($this); - $this->oStandardPopAction = new CCommonPopAction($this); - $this->oTableAjaxAction = new CCommonAjaxAction($this); - - $aTabs =& $oAdminPanel->GetTabs(); - - if (\CApi::GetConf('labs.allow-social-integration', true)) - { - array_push($aTabs, - array(CApi::I18N('ADMIN_PANEL/TABNAME_COMMON'), AP_TAB_COMMON) - ); - } - - array_push($aTabs, - array(CApi::I18N('ADMIN_PANEL/TABNAME_DOMAINS'), AP_TAB_DOMAINS), - array(CApi::I18N('ADMIN_PANEL/TABNAME_SYSTEM'), AP_TAB_SYSTEM) - ); - } - - /** - * @param int $iDomainId - * @return CDomain - */ - public function getDomain($iDomainId) - { - if (0 === $iDomainId) - { - return $this->oDomainsApi->getDefaultDomain(); - } - - return $this->oDomainsApi->getDomainById($iDomainId); - } - - /** - * @param CDomain $oDomain - * @return bool - */ - public function updateDomain(CDomain $oDomain) - { - $aTabs = $this->getTabList($oDomain); - if (is_array($aTabs) && count($aTabs) > 0) - { - $aTabKeys = array_keys($aTabs); - if (!in_array($oDomain->DefaultTab, $aTabKeys)) - { - $oDomain->DefaultTab = $aTabKeys[0]; - } - } - - if (!$this->oDomainsApi->updateDomain($oDomain)) - { - $this->lastErrorCode = $this->oDomainsApi->getLastErrorCode(); - $this->lastErrorMessage = $this->oDomainsApi->GetLastErrorMessage(); - return false; - } - - if (CSession::Has(AP_SESS_DOMAIN_NEXT_EDIT_ID) && - $oDomain->IdDomain === CSession::get(AP_SESS_DOMAIN_NEXT_EDIT_ID, null)) - { - CSession::clear(AP_SESS_DOMAIN_NEXT_EDIT_ID); - } - - return true; - } - - /** - * @param string $sDomainName - * @return bool - */ - public function domainExists($sDomainName) - { - return $this->oDomainsApi->domainExists($sDomainName); - } - - /** - * @return bool - */ - public function hasSslSupport() - { - return $this->oCapabilityApi->hasSslSupport(); - } - - /** - * @param string $sTab - * @param ap_Screen $oScreen - */ - protected function initStandardMenuByTab($sTab, ap_Screen &$oScreen) - { - switch ($sTab) - { - case AP_TAB_SYSTEM: - $oScreen->AddMenuItem(CM_MODE_DB, CM_MODE_DB_NAME, $this->sPath.'/templates/db.php'); - $oScreen->AddMenuItem(CM_MODE_SECURITY, CM_MODE_SECURITY_NAME, $this->sPath.'/templates/security.php'); - $oScreen->SetDefaultMode(CM_MODE_DB); - break; - - case AP_TAB_COMMON: - - if (\CApi::GetConf('labs.allow-social-integration', true)) - { - $oScreen->AddMenuItem(CM_MODE_SOCIAL, CM_MODE_SOCIAL_NAME, - $this->sPath.'/templates/social-header.php'); -/* - if ($this->oAdminPanel->AType) - { - $oScreen->AddMenuItem(CM_MODE_SOCIAL, CM_MODE_SOCIAL_NAME, - $this->sPath.'/templates/social-aurora.php'); - } -*/ - $oScreen->AddMenuItem(CM_MODE_SOCIAL, CM_MODE_SOCIAL_NAME, - $this->sPath.'/templates/social.php'); - $oScreen->AddMenuItem(CM_MODE_SOCIAL, CM_MODE_SOCIAL_NAME, - $this->sPath.'/templates/social-footer.php'); - } - - break; - } - } - - /** - * @param string $sTab - * @param ap_Screen $oScreen - */ - protected function initTableTopMenu($sTab, ap_Screen &$oScreen) - { - switch ($sTab) - { - case AP_TAB_DOMAINS: - $this->JsAddFile('domains.js'); - break; - } - } - - /** - * @param string $sTab - * @param ap_Screen $oScreen - */ - protected function initTableListHeaders($sTab, ap_Screen &$oScreen) - { - $oScreen->SetEmptySearch(AP_LANG_RESULTEMPTY); - switch ($sTab) - { - case AP_TAB_DOMAINS: - $oScreen->ClearHeaders(); - $oScreen->AddHeader('Name', 138, true); - $oScreen->SetEmptyList(CM_LANG_NODOMAINS); - $oScreen->SetEmptySearch(CM_LANG_NODOMAINS_RESULTEMPTY); - break; - } - } - - /** - * @param string $sTab - * @param ap_Screen $oScreen - */ - protected function initTableList($sTab, ap_Screen &$oScreen) - { - if (AP_TAB_DOMAINS === $sTab) - { - $iTenantId = $this->oAdminPanel->RType() ? $this->oAdminPanel->TenantId() : 0; - - $sSearchDesc = $oScreen->GetSearchDesc(); - $iAllCount = $this->oDomainsApi->getDomainCount($sSearchDesc, $iTenantId); - $oScreen->EnableSearch(($iAllCount > 1) || $sSearchDesc); - - $bAddDefaultDomain = false; - if (0 === $iTenantId && $this->oAdminPanel->HasAccessDomain(0)) - { - $iAllCount += ceil($iAllCount / ($oScreen->GetLinesPerPage() - 1)); - $bAddDefaultDomain = true; - $oScreen->AddListItem(0, array( - 'Name' => CApi::I18N('ADMIN_PANEL/DOMAINS_DEFAULT') - ), true); - } - - $oScreen->SetAllListCount($iAllCount); - - $aDomainsList = $this->oDomainsApi->getDomainsList($oScreen->GetPage(), - $bAddDefaultDomain ? $oScreen->GetLinesPerPage() - 1 : $oScreen->GetLinesPerPage(), - $oScreen->GetOrderBy(), $oScreen->GetOrderType(), $sSearchDesc, $iTenantId); - - if (is_array($aDomainsList) && 0 < count($aDomainsList)) - { - foreach ($aDomainsList as $iDomainId => $aDomainArray) - { - if ($this->oAdminPanel->HasAccessDomain($iDomainId)) - { - $sName = isset($aDomainArray[1]) ? $aDomainArray[1] : ''; - - if (strpos($sName, '*') !== false) - { - $oTenant = null; - if ($iTenantId === 0) - { - $oDomain = $this->oDomainsApi->getDomainByName($aDomainArray[1]); - if ($oDomain) - { - if ($oDomain->IsDefaultTenantDomain && $this->oAdminPanel->RType()) - { - $oTenant = $this->oTenantsApi->getTenantById($oDomain->IdTenant); - if ($oTenant) - { - $sName = CApi::I18N('ADMIN_PANEL/DOMAINS_DEFAULT_TENANT') . ' (' . $oTenant->Login . ')'; - } - } - else - { - continue; - } - } - - } - else - { - $oDomain = $this->oDomainsApi->getDomainByName($aDomainArray[1]); - if ($oDomain) - { - if ($oDomain->IsDefaultTenantDomain) - { - $sName = CApi::I18N('ADMIN_PANEL/DOMAINS_DEFAULT_TENANT'); - } - } - } - } - else - { - if ($this->oAdminPanel->RType()) - { - $oDomain = $this->oDomainsApi->getDomainByName($aDomainArray[1]); - if ($oDomain) - { - $oTenant = $this->oTenantsApi->getTenantById($oDomain->IdTenant); - if ($oTenant) - { - if ($iTenantId === 0) - { - $sName = $sName . ' (' . $oTenant->Login . ')'; - } - } - else - { - $sName = $sName . ' (' . CApi::I18N('ADMIN_PANEL/NOT_IN_TENANT') . ')'; - } - } - } - } - $oScreen->AddListItem($iDomainId, array( - 'Type' => ($aDomainArray[0]) - ? '' - : '', - 'Name' => $sName - )); - } - } - } - } - } - - /** - * @param string $sTab - * @param ap_Screen $oScreen - */ - protected function initTableMainSwitchers($sTab, ap_Screen &$oScreen) - { - $sMainAction = $this->getQueryAction(); - if (AP_TAB_DOMAINS === $sTab) - { - switch ($sMainAction) - { - case 'edit': - $iDomainId = isset($_GET['uid']) ? (int) $_GET['uid'] : null; - $iTenantId = $this->oAdminPanel->TenantId(); - - $oDomain = null; - if ($this->oAdminPanel->HasAccessDomain($iDomainId)) - { - $oDomain =& $this->oAdminPanel->GetMainObject('domain_edit'); - if (!$oDomain && null !== $iDomainId) - { - $oDomain = $this->getDomain($iDomainId); - if ($oDomain && (0 === $iTenantId || $iTenantId === $oDomain->IdTenant)) - { - $this->oAdminPanel->SetMainObject('domain_edit', $oDomain); - } - else - { - $oDomain = null; - } - } - } - - if ($oDomain) - { - $sTenantAddString = ''; - if (0 < $oDomain->IdTenant && $this->oTenantsApi) - { - $oTenant = $this->oTenantsApi->getTenantById($oDomain->IdTenant); - if ($oTenant) - { - $this->oAdminPanel->SetMainObject('domain_edit_tenant', $oTenant); - if ($this->oAdminPanel->RType() && 0 === $this->oAdminPanel->TenantId()) - { - $sTenantAddString = 0 < strlen($oTenant->Login) ? ' ('.$oTenant->Login.')': ''; - } - } - } - - $oScreen->Data->SetValue('strDomainName', $oDomain->Name.$sTenantAddString); - if (0 === $oDomain->IdDomain) - { - $oScreen->Data->SetValue('strDomainName', CApi::I18N('ADMIN_PANEL/DOMAINS_DEFAULT')); - } - if ($oDomain->IsDefaultTenantDomain) - { - $oScreen->Data->SetValue('strDomainName', CApi::I18N('ADMIN_PANEL/DOMAINS_DEFAULT_TENANT').$sTenantAddString); - } - - $oScreen->Main->AddTopSwitcher($this->sPath.'/templates/main-top-edit-domain-name.php'); - $oScreen->Main->AddTopSwitcher($this->sPath.'/templates/main-top-edit-domain.php'); - } - - break; - } - } - - } - - /** - * @param string $sTab - * @param ap_Screen $oScreen - */ - protected function initTableMainSwitchersPost($sTab, ap_Screen &$oScreen) - { - $sMainAction = $this->getQueryAction(); - if (AP_TAB_DOMAINS === $sTab) - { - switch ($sMainAction) - { - case 'edit': - $oDomain =& $this->oAdminPanel->GetMainObject('domain_edit'); - if ($oDomain) - { - $oScreen->Main->AddSwitcher( - WM_SWITCHER_MODE_EDIT_DOMAIN_GENERAL, WM_SWITCHER_MODE_EDIT_DOMAIN_GENERAL_NAME, - $this->sPath.'/templates/main-edit-domain-general-webmail.php'); - $oScreen->Main->AddSwitcher( - WM_SWITCHER_MODE_EDIT_DOMAIN_GENERAL, WM_SWITCHER_MODE_EDIT_DOMAIN_GENERAL_NAME, - $this->sPath.'/templates/main-edit-domain-general-regional.php'); - } - break; - } - } - } - - /** - * @return void - */ - protected function initInclude() - { - include $this->sPath.'/inc/constants.php'; - include $this->sPath.'/inc/populate.php'; - include $this->sPath.'/inc/post.php'; - include $this->sPath.'/inc/pop.php'; - include $this->sPath.'/inc/ajax.php'; - } - - /** - * @return void - */ - public function AuthCheckSet() - { - $mType = CSession::get(AP_SESS_AUTH_TYPE, null); - if (null !== $mType && md5(CSession::Id().AP_VERSION.__FILE__) === CSession::get(AP_SESS_AUTH, null)) - { - $this->setAdminAccessType((int) $mType); - $this->setAdminAccessDomains(CSession::get(AP_SESS_AUTH_DOMAINS, null)); - - if (AP_SESS_AUTH_TYPE_TENANT === $this->oAdminPanel->AuthType()) - { - $iTenantId = (int) CSession::get(AP_SESS_AUTH_TENANT_ID, 0); - if (0 < $iTenantId) - { - $this->setTenantAccessId($iTenantId); - } - } - } - } - - /** - * @param string $sLogin - * @param string $sPassword - * @return bool - */ - public function AuthLogin($sLogin, $sPassword) - { - $oSettings = null; - $oSettings =& CApi::GetSettings(); - $sDemoLogin = CApi::GetConf('demo.adminpanel.login', ''); - - $sLogin = trim($sLogin); - $sPassword = trim($sPassword); - - if (empty($sLogin) || empty($sPassword)) - { - return false; - } - - if ($oSettings->GetConf('Common/AdminLogin') === $sLogin && - $this->oWebmailApi->validateAdminPassword($sPassword)) - { - $this->setAdminAccessType(AP_SESS_AUTH_TYPE_SUPER_ADMIN); - return true; - } - else if (CApi::GetConf('demo.adminpanel.enable', false) && - 0 < strlen($sDemoLogin) && $sDemoLogin === CPost::get('AdmloginInput')) - { - $this->setAdminAccessType(AP_SESS_AUTH_TYPE_SUPER_ADMIN_ONLYREAD); - return true; - } - else if ($this->oAdminPanel->PType() && $this->oAdminPanel->RType()) - { - $iTenantId = $this->oAdminPanel->CallModuleFunction('CProModule', - 'GetTenantIdByLoginPassword', array($sLogin, $sPassword)); - - if (0 < $iTenantId) - { - $oTenant = $this->oAdminPanel->CallModuleFunction('CProModule', - 'getTenantById', array($iTenantId)); - - if ($oTenant) - { - /* @var $oTenant CTenant */ - if (0 < $oTenant->Expared && $oTenant->Expared < \time()) - { - $sDesc = '
'; - $sDesc .= '

'.CAPi::I18N('ADMIN_PANEL/YOUR_SUBSCRIPTION_IS_EXPIRED').'

'; - if (0 < strlen($oTenant->PayUrl)) - { - $sDesc .= '

'.CAPi::I18N('ADMIN_PANEL/TO_RENEW_FOLLOW_LINK'). - ' '.$oTenant->PayUrl.'

'; - } - - $sDesc .= '
'; - - CSession::Set('SESSION_LOGIN_WARNING', $sDesc); - return true; - } - - $this->setAdminAccessType(AP_SESS_AUTH_TYPE_TENANT); - $this->setTenantAccessId($iTenantId); - return true; - } - } - } - - return false; - } - - /** - * @param int $iAccessType - */ - protected function setAdminAccessType($iAccessType = AP_SESS_AUTH_TYPE_NONE) - { - $this->oAdminPanel->SetAuthType((int) $iAccessType); - if (in_array((int) $iAccessType, array(AP_SESS_AUTH_TYPE_TENANT, - AP_SESS_AUTH_TYPE_SUPER_ADMIN, AP_SESS_AUTH_TYPE_SUPER_ADMIN_ONLYREAD))) - { - $this->oAdminPanel->SetIsAuth(true); - CSession::Set(AP_SESS_AUTH, md5(CSession::Id().AP_VERSION.__FILE__)); - CSession::Set(AP_SESS_AUTH_TYPE, (int) $iAccessType); - } - } - - /** - * @param array $aDomainsIds - */ - protected function setAdminAccessDomains($aDomainsIds) - { - CSession::Set(AP_SESS_AUTH_DOMAINS, is_array($aDomainsIds) ? $aDomainsIds : null); - $this->oAdminPanel->SetAuthDomains($aDomainsIds); - } - - /** - * @param int $iTenantId - */ - protected function setTenantAccessId($iTenantId) - { - CSession::Set(AP_SESS_AUTH_TENANT_ID, $iTenantId); - $this->oAdminPanel->SetAuthTenantId($iTenantId); -// if (0 < $iTenantId) -// { -// $oTenant = $this->oAdminPanel->GetTenantAdminObject(); -// if ($oTenant) -// { -// $this->oAdminPanel->SetTenantTabsInfo($oTenant); -// } -// } - } - - /** - * @return CTenant - */ - public function GetTenantAdminObject() - { - $oTenant = null; - $iTenantId = $this->oAdminPanel->TenantId(); - - if ($this->oTenantsApi) - { - if (0 < $iTenantId) - { - $oTenant = $this->oTenantsApi->getTenantById($iTenantId); - } - else - { - $oTenant = $this->oTenantsApi->getDefaultGlobalTenant(); - } - } - - return $oTenant; - } - - /** - * @param CTenant $oTenant - */ - public function UpdateTenantAdminObject($oTenant) - { - $bResult = false; - $iTenantId = $this->oAdminPanel->TenantId(); - - if ($this->oTenantsApi && $oTenant && (0 === $iTenantId ||0 < $iTenantId && $iTenantId === $oTenant->IdTenant)) - { - $bResult = $this->oTenantsApi->updateTenant($oTenant); - } - - return $bResult; - } - - /** - * @return array - */ - public function GetTimeZoneList() - { - return array( - CApi::I18N('ADMIN_PANEL/FORM_DEFAULT'), #0 - '(GMT -12:00) Eniwetok, Kwajalein, Dateline Time', #1 - '(GMT -11:00) Midway Island, Samoa', #2 - '(GMT -10:00) Hawaii', #3 - '(GMT -09:00) Alaska', #4 - '(GMT -08:00) Pacific Time (US & Canada), Tijuana', #5 - '(GMT -07:00) Arizona', #6 - '(GMT -07:00) Mountain Time (US & Canada)', #7 - '(GMT -06:00) Central America', #8 - '(GMT -06:00) Central Time (US & Canada)', #9 - '(GMT -06:00) Mexico City, Tegucigalpa', #10 - '(GMT -06:00) Saskatchewan', #11 - '(GMT -05:00) Indiana (East)', #12 - '(GMT -05:00) Eastern Time (US & Canada)', #13 - '(GMT -05:00) Bogota, Lima, Quito', #14 - '(GMT -04:00) Santiago', #15 - '(GMT -04:00) Caracas, La Paz', #16 - '(GMT -04:00) Atlantic Time (Canada)', #17 - '(GMT -03:30) Newfoundland', #18 - '(GMT -03:00) Greenland', #19 - '(GMT -03:00) Buenos Aires, Georgetown', #20 - '(GMT -03:00) Brasilia', #21 - '(GMT -02:00) Mid-Atlantic', #22 - '(GMT -01:00) Cape Verde Is.', #23 - '(GMT -01:00) Azores', #24 - '(GMT) Casablanca, Monrovia', #25 - '(GMT) Dublin, Edinburgh, Lisbon, London', #26 - '(GMT +01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna', #27 - '(GMT +01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague', #28 - '(GMT +01:00) Brussels, Copenhagen, Madrid, Paris', #29 - '(GMT +01:00) Sarajevo, Skopje, Sofija, Warsaw, Zagreb', #30 - '(GMT +01:00) West Central Africa', #31 - '(GMT +02:00) Athens, Istanbul, Minsk', #32 - '(GMT +02:00) Bucharest', #33 - '(GMT +02:00) Cairo', #34 - '(GMT +02:00) Harare, Pretoria', #35 - '(GMT +02:00) Helsinki, Riga, Tallinn, Vilnius', #36 - '(GMT +02:00) Israel, Jerusalem Standard Time', #37 - '(GMT +03:00) Baghdad', #38 - '(GMT +03:00) Arab, Kuwait, Riyadh', #39 - '(GMT +03:00) East Africa, Nairobi', #40 - '(GMT +03:00) Moscow, St. Petersburg, Volgograd', #41 - '(GMT +03:30) Tehran', #42 - '(GMT +04:00) Abu Dhabi, Muscat', #43 - '(GMT +04:00) Baku, Tbilisi, Yerevan', #44 - '(GMT +04:30) Kabul', #45 - '(GMT +05:00) Islamabad, Karachi, Sverdlovsk, Tashkent', #46 - '(GMT +05:30) Calcutta, Chennai, Mumbai, New Delhi, India Standard Time', #47 - '(GMT +05:45) Kathmandu, Nepal', #48 - '(GMT +06:00) Ekaterinburg', #49 - '(GMT +06:00) Almaty, North Central Asia', #50 - '(GMT +06:00) Astana, Dhaka', #51 - '(GMT +06:00) Sri Jayawardenepura, Sri Lanka', #52 - '(GMT +06:30) Rangoon', #53 - '(GMT +07:00) Bangkok, Novosibirsk, Hanoi, Jakarta', #54 - '(GMT +08:00) Krasnoyarsk', #55 - '(GMT +08:00) Beijing, Chongqing, Hong Kong SAR, Urumqi', #56 - '(GMT +08:00) Ulaan Bataar', #57 - '(GMT +08:00) Kuala Lumpur, Singapore', #58 - '(GMT +08:00) Perth, Western Australia', #59 - '(GMT +08:00) Taipei', #60 - '(GMT +09:00) Osaka, Sapporo, Tokyo, Irkutsk', #61 - '(GMT +09:00) Seoul, Korea Standard time', #62 - '(GMT +09:30) Adelaide, Central Australia', #63 - '(GMT +09:30) Darwin', #64 - '(GMT +10:00) Yakutsk', #65 - '(GMT +10:00) Brisbane, East Australia', #66 - '(GMT +10:00) Canberra, Melbourne, Sydney, Hobart', #67 - '(GMT +10:00) Guam, Port Moresby', #68 - '(GMT +10:00) Hobart, Tasmania', #69 - '(GMT +11:00) Vladivostok', #70 - '(GMT +11:00) Solomon Is., New Caledonia', #71 - '(GMT +12:00) Auckland, Wellington, Magadan', #72 - '(GMT +12:00) Fiji Islands, Kamchatka, Marshall Is.', #73 - '(GMT +13:00) Nuku\'alofa, Tonga' #74 - ); - } - - /** - * @return array - */ - public function GetSkinList() - { - return $this->oIntegratorApi->getThemeList(); - } - - /** - * @return array - */ - public function GetLangsList() - { - return $this->oIntegratorApi->getLanguageList(); - } - - /** - * @return array - */ - public function getTabList($oDomain) - { - return $this->oIntegratorApi->getTabList($oDomain); - } -} - +oDomainsApi = CApi::Manager('domains'); + $this->oUsersApi = CApi::Manager('users'); + $this->oCapabilityApi = CApi::Manager('capability'); + $this->oWebmailApi = CApi::Manager('webmail'); + $this->oIntegratorApi = CApi::Manager('integrator'); + $this->oTenantsApi = CApi::Manager('tenants'); + + if (\CApi::GetConf('labs.allow-social-integration', true)) + { + $this->aTabs[] = AP_TAB_COMMON; + } + + $this->aTabs[] = AP_TAB_DOMAINS; + $this->aTabs[] = AP_TAB_SYSTEM; + + $this->aQueryActions[] = 'edit'; + $this->aQueryActions[] = 'list'; + + $this->oPopulateData = new CCommonPopulateData($this); + $this->oStandardPostAction = new CCommonPostAction($this); + $this->oStandardPopAction = new CCommonPopAction($this); + $this->oTableAjaxAction = new CCommonAjaxAction($this); + + $aTabs =& $oAdminPanel->GetTabs(); + + if (\CApi::GetConf('labs.allow-social-integration', true)) + { + array_push($aTabs, + array(CApi::I18N('ADMIN_PANEL/TABNAME_COMMON'), AP_TAB_COMMON) + ); + } + + array_push($aTabs, + array(CApi::I18N('ADMIN_PANEL/TABNAME_DOMAINS'), AP_TAB_DOMAINS), + array(CApi::I18N('ADMIN_PANEL/TABNAME_SYSTEM'), AP_TAB_SYSTEM) + ); + } + + /** + * @param int $iDomainId + * @return CDomain + */ + public function getDomain($iDomainId) + { + if (0 === $iDomainId) + { + return $this->oDomainsApi->getDefaultDomain(); + } + + return $this->oDomainsApi->getDomainById($iDomainId); + } + + /** + * @param CDomain $oDomain + * @return bool + */ + public function updateDomain(CDomain $oDomain) + { + $aTabs = $this->getTabList($oDomain); + if (is_array($aTabs) && count($aTabs) > 0) + { + $aTabKeys = array_keys($aTabs); + if (!in_array($oDomain->DefaultTab, $aTabKeys)) + { + $oDomain->DefaultTab = $aTabKeys[0]; + } + } + + if (!$this->oDomainsApi->updateDomain($oDomain)) + { + $this->lastErrorCode = $this->oDomainsApi->getLastErrorCode(); + $this->lastErrorMessage = $this->oDomainsApi->GetLastErrorMessage(); + return false; + } + + if (CSession::Has(AP_SESS_DOMAIN_NEXT_EDIT_ID) && + $oDomain->IdDomain === CSession::get(AP_SESS_DOMAIN_NEXT_EDIT_ID, null)) + { + CSession::clear(AP_SESS_DOMAIN_NEXT_EDIT_ID); + } + + return true; + } + + /** + * @param string $sDomainName + * @return bool + */ + public function domainExists($sDomainName) + { + return $this->oDomainsApi->domainExists($sDomainName); + } + + /** + * @return bool + */ + public function hasSslSupport() + { + return $this->oCapabilityApi->hasSslSupport(); + } + + /** + * @param string $sTab + * @param ap_Screen $oScreen + */ + protected function initStandardMenuByTab($sTab, ap_Screen &$oScreen) + { + switch ($sTab) + { + case AP_TAB_SYSTEM: + $oScreen->AddMenuItem(CM_MODE_DB, CM_MODE_DB_NAME, $this->sPath.'/templates/db.php'); + $oScreen->AddMenuItem(CM_MODE_SECURITY, CM_MODE_SECURITY_NAME, $this->sPath.'/templates/security.php'); + $oScreen->SetDefaultMode(CM_MODE_DB); + break; + + case AP_TAB_COMMON: + + if (\CApi::GetConf('labs.allow-social-integration', true)) + { + $oScreen->AddMenuItem(CM_MODE_SOCIAL, CM_MODE_SOCIAL_NAME, + $this->sPath.'/templates/social-header.php'); +/* + if ($this->oAdminPanel->AType) + { + $oScreen->AddMenuItem(CM_MODE_SOCIAL, CM_MODE_SOCIAL_NAME, + $this->sPath.'/templates/social-aurora.php'); + } +*/ + $oScreen->AddMenuItem(CM_MODE_SOCIAL, CM_MODE_SOCIAL_NAME, + $this->sPath.'/templates/social.php'); + $oScreen->AddMenuItem(CM_MODE_SOCIAL, CM_MODE_SOCIAL_NAME, + $this->sPath.'/templates/social-footer.php'); + } + + break; + } + } + + /** + * @param string $sTab + * @param ap_Screen $oScreen + */ + protected function initTableTopMenu($sTab, ap_Screen &$oScreen) + { + switch ($sTab) + { + case AP_TAB_DOMAINS: + $this->JsAddFile('domains.js'); + break; + } + } + + /** + * @param string $sTab + * @param ap_Screen $oScreen + */ + protected function initTableListHeaders($sTab, ap_Screen &$oScreen) + { + $oScreen->SetEmptySearch(AP_LANG_RESULTEMPTY); + switch ($sTab) + { + case AP_TAB_DOMAINS: + $oScreen->ClearHeaders(); + $oScreen->AddHeader('Name', 138, true); + $oScreen->SetEmptyList(CM_LANG_NODOMAINS); + $oScreen->SetEmptySearch(CM_LANG_NODOMAINS_RESULTEMPTY); + break; + } + } + + /** + * @param string $sTab + * @param ap_Screen $oScreen + */ + protected function initTableList($sTab, ap_Screen &$oScreen) + { + if (AP_TAB_DOMAINS === $sTab) + { + $iTenantId = $this->oAdminPanel->RType() ? $this->oAdminPanel->TenantId() : 0; + + $sSearchDesc = $oScreen->GetSearchDesc(); + $iAllCount = $this->oDomainsApi->getDomainCount($sSearchDesc, $iTenantId); + $oScreen->EnableSearch(($iAllCount > 1) || $sSearchDesc); + + $bAddDefaultDomain = false; + if (0 === $iTenantId && $this->oAdminPanel->HasAccessDomain(0)) + { + $iAllCount += ceil($iAllCount / ($oScreen->GetLinesPerPage() - 1)); + $bAddDefaultDomain = true; + $oScreen->AddListItem(0, array( + 'Name' => CApi::I18N('ADMIN_PANEL/DOMAINS_DEFAULT') + ), true); + } + + $oScreen->SetAllListCount($iAllCount); + + $aDomainsList = $this->oDomainsApi->getDomainsList($oScreen->GetPage(), + $bAddDefaultDomain ? $oScreen->GetLinesPerPage() - 1 : $oScreen->GetLinesPerPage(), + $oScreen->GetOrderBy(), $oScreen->GetOrderType(), $sSearchDesc, $iTenantId); + + if (is_array($aDomainsList) && 0 < count($aDomainsList)) + { + foreach ($aDomainsList as $iDomainId => $aDomainArray) + { + if ($this->oAdminPanel->HasAccessDomain($iDomainId)) + { + $sName = isset($aDomainArray[1]) ? $aDomainArray[1] : ''; + + if (strpos($sName, '*') !== false) + { + $oTenant = null; + if ($iTenantId === 0) + { + $oDomain = $this->oDomainsApi->getDomainByName($aDomainArray[1]); + if ($oDomain) + { + if ($oDomain->IsDefaultTenantDomain && $this->oAdminPanel->RType()) + { + $oTenant = $this->oTenantsApi->getTenantById($oDomain->IdTenant); + if ($oTenant) + { + $sName = CApi::I18N('ADMIN_PANEL/DOMAINS_DEFAULT_TENANT') . ' (' . $oTenant->Login . ')'; + } + } + else + { + continue; + } + } + + } + else + { + $oDomain = $this->oDomainsApi->getDomainByName($aDomainArray[1]); + if ($oDomain) + { + if ($oDomain->IsDefaultTenantDomain) + { + $sName = CApi::I18N('ADMIN_PANEL/DOMAINS_DEFAULT_TENANT'); + } + } + } + } + else + { + if ($this->oAdminPanel->RType()) + { + $oDomain = $this->oDomainsApi->getDomainByName($aDomainArray[1]); + if ($oDomain) + { + $oTenant = $this->oTenantsApi->getTenantById($oDomain->IdTenant); + if ($oTenant) + { + if ($iTenantId === 0) + { + $sName = $sName . ' (' . $oTenant->Login . ')'; + } + } + else + { + $sName = $sName . ' (' . CApi::I18N('ADMIN_PANEL/NOT_IN_TENANT') . ')'; + } + } + } + } + $oScreen->AddListItem($iDomainId, array( + 'Type' => ($aDomainArray[0]) + ? '' + : '', + 'Name' => $sName + )); + } + } + } + } + } + + /** + * @param string $sTab + * @param ap_Screen $oScreen + */ + protected function initTableMainSwitchers($sTab, ap_Screen &$oScreen) + { + $sMainAction = $this->getQueryAction(); + if (AP_TAB_DOMAINS === $sTab) + { + switch ($sMainAction) + { + case 'edit': + $iDomainId = isset($_GET['uid']) ? (int) $_GET['uid'] : null; + $iTenantId = $this->oAdminPanel->TenantId(); + + $oDomain = null; + if ($this->oAdminPanel->HasAccessDomain($iDomainId)) + { + $oDomain =& $this->oAdminPanel->GetMainObject('domain_edit'); + if (!$oDomain && null !== $iDomainId) + { + $oDomain = $this->getDomain($iDomainId); + if ($oDomain && (0 === $iTenantId || $iTenantId === $oDomain->IdTenant)) + { + $this->oAdminPanel->SetMainObject('domain_edit', $oDomain); + } + else + { + $oDomain = null; + } + } + } + + if ($oDomain) + { + $sTenantAddString = ''; + if (0 < $oDomain->IdTenant && $this->oTenantsApi) + { + $oTenant = $this->oTenantsApi->getTenantById($oDomain->IdTenant); + if ($oTenant) + { + $this->oAdminPanel->SetMainObject('domain_edit_tenant', $oTenant); + if ($this->oAdminPanel->RType() && 0 === $this->oAdminPanel->TenantId()) + { + $sTenantAddString = 0 < strlen($oTenant->Login) ? ' ('.$oTenant->Login.')': ''; + } + } + } + + $oScreen->Data->SetValue('strDomainName', $oDomain->Name.$sTenantAddString); + if (0 === $oDomain->IdDomain) + { + $oScreen->Data->SetValue('strDomainName', CApi::I18N('ADMIN_PANEL/DOMAINS_DEFAULT')); + } + if ($oDomain->IsDefaultTenantDomain) + { + $oScreen->Data->SetValue('strDomainName', CApi::I18N('ADMIN_PANEL/DOMAINS_DEFAULT_TENANT').$sTenantAddString); + } + + $oScreen->Main->AddTopSwitcher($this->sPath.'/templates/main-top-edit-domain-name.php'); + $oScreen->Main->AddTopSwitcher($this->sPath.'/templates/main-top-edit-domain.php'); + } + + break; + } + } + + } + + /** + * @param string $sTab + * @param ap_Screen $oScreen + */ + protected function initTableMainSwitchersPost($sTab, ap_Screen &$oScreen) + { + $sMainAction = $this->getQueryAction(); + if (AP_TAB_DOMAINS === $sTab) + { + switch ($sMainAction) + { + case 'edit': + $oDomain =& $this->oAdminPanel->GetMainObject('domain_edit'); + if ($oDomain) + { + $oScreen->Main->AddSwitcher( + WM_SWITCHER_MODE_EDIT_DOMAIN_GENERAL, WM_SWITCHER_MODE_EDIT_DOMAIN_GENERAL_NAME, + $this->sPath.'/templates/main-edit-domain-general-webmail.php'); + $oScreen->Main->AddSwitcher( + WM_SWITCHER_MODE_EDIT_DOMAIN_GENERAL, WM_SWITCHER_MODE_EDIT_DOMAIN_GENERAL_NAME, + $this->sPath.'/templates/main-edit-domain-general-regional.php'); + } + break; + } + } + } + + /** + * @return void + */ + protected function initInclude() + { + include $this->sPath.'/inc/constants.php'; + include $this->sPath.'/inc/populate.php'; + include $this->sPath.'/inc/post.php'; + include $this->sPath.'/inc/pop.php'; + include $this->sPath.'/inc/ajax.php'; + } + + /** + * @return void + */ + public function AuthCheckSet() + { + $mType = CSession::get(AP_SESS_AUTH_TYPE, null); + if (null !== $mType && md5(CSession::Id().AP_VERSION.__FILE__) === CSession::get(AP_SESS_AUTH, null)) + { + $this->setAdminAccessType((int) $mType); + $this->setAdminAccessDomains(CSession::get(AP_SESS_AUTH_DOMAINS, null)); + + if (AP_SESS_AUTH_TYPE_TENANT === $this->oAdminPanel->AuthType()) + { + $iTenantId = (int) CSession::get(AP_SESS_AUTH_TENANT_ID, 0); + if (0 < $iTenantId) + { + $this->setTenantAccessId($iTenantId); + } + } + } + } + + /** + * @param string $sLogin + * @param string $sPassword + * @return bool + */ + public function AuthLogin($sLogin, $sPassword) + { + $oSettings = null; + $oSettings =& CApi::GetSettings(); + $sDemoLogin = CApi::GetConf('demo.adminpanel.login', ''); + + $sLogin = trim($sLogin); + $sPassword = trim($sPassword); + + if (empty($sLogin) || empty($sPassword)) + { + return false; + } + + if ($oSettings->GetConf('Common/AdminLogin') === $sLogin && + $this->oWebmailApi->validateAdminPassword($sPassword)) + { + $this->setAdminAccessType(AP_SESS_AUTH_TYPE_SUPER_ADMIN); + return true; + } + else if (CApi::GetConf('demo.adminpanel.enable', false) && + 0 < strlen($sDemoLogin) && $sDemoLogin === CPost::get('AdmloginInput')) + { + $this->setAdminAccessType(AP_SESS_AUTH_TYPE_SUPER_ADMIN_ONLYREAD); + return true; + } + else if ($this->oAdminPanel->PType() && $this->oAdminPanel->RType()) + { + $iTenantId = $this->oAdminPanel->CallModuleFunction('CProModule', + 'GetTenantIdByLoginPassword', array($sLogin, $sPassword)); + + if (0 < $iTenantId) + { + $oTenant = $this->oAdminPanel->CallModuleFunction('CProModule', + 'getTenantById', array($iTenantId)); + + if ($oTenant) + { + /* @var $oTenant CTenant */ + if (0 < $oTenant->Expared && $oTenant->Expared < \time()) + { + $sDesc = '
'; + $sDesc .= '

'.CAPi::I18N('ADMIN_PANEL/YOUR_SUBSCRIPTION_IS_EXPIRED').'

'; + if (0 < strlen($oTenant->PayUrl)) + { + $sDesc .= '

'.CAPi::I18N('ADMIN_PANEL/TO_RENEW_FOLLOW_LINK'). + ' '.$oTenant->PayUrl.'

'; + } + + $sDesc .= '
'; + + CSession::Set('SESSION_LOGIN_WARNING', $sDesc); + return true; + } + + $this->setAdminAccessType(AP_SESS_AUTH_TYPE_TENANT); + $this->setTenantAccessId($iTenantId); + return true; + } + } + } + + return false; + } + + /** + * @param int $iAccessType + */ + protected function setAdminAccessType($iAccessType = AP_SESS_AUTH_TYPE_NONE) + { + $this->oAdminPanel->SetAuthType((int) $iAccessType); + if (in_array((int) $iAccessType, array(AP_SESS_AUTH_TYPE_TENANT, + AP_SESS_AUTH_TYPE_SUPER_ADMIN, AP_SESS_AUTH_TYPE_SUPER_ADMIN_ONLYREAD))) + { + $this->oAdminPanel->SetIsAuth(true); + CSession::Set(AP_SESS_AUTH, md5(CSession::Id().AP_VERSION.__FILE__)); + CSession::Set(AP_SESS_AUTH_TYPE, (int) $iAccessType); + } + } + + /** + * @param array $aDomainsIds + */ + protected function setAdminAccessDomains($aDomainsIds) + { + CSession::Set(AP_SESS_AUTH_DOMAINS, is_array($aDomainsIds) ? $aDomainsIds : null); + $this->oAdminPanel->SetAuthDomains($aDomainsIds); + } + + /** + * @param int $iTenantId + */ + protected function setTenantAccessId($iTenantId) + { + CSession::Set(AP_SESS_AUTH_TENANT_ID, $iTenantId); + $this->oAdminPanel->SetAuthTenantId($iTenantId); +// if (0 < $iTenantId) +// { +// $oTenant = $this->oAdminPanel->GetTenantAdminObject(); +// if ($oTenant) +// { +// $this->oAdminPanel->SetTenantTabsInfo($oTenant); +// } +// } + } + + /** + * @return CTenant + */ + public function GetTenantAdminObject() + { + $oTenant = null; + $iTenantId = $this->oAdminPanel->TenantId(); + + if ($this->oTenantsApi) + { + if (0 < $iTenantId) + { + $oTenant = $this->oTenantsApi->getTenantById($iTenantId); + } + else + { + $oTenant = $this->oTenantsApi->getDefaultGlobalTenant(); + } + } + + return $oTenant; + } + + /** + * @param CTenant $oTenant + */ + public function UpdateTenantAdminObject($oTenant) + { + $bResult = false; + $iTenantId = $this->oAdminPanel->TenantId(); + + if ($this->oTenantsApi && $oTenant && (0 === $iTenantId ||0 < $iTenantId && $iTenantId === $oTenant->IdTenant)) + { + $bResult = $this->oTenantsApi->updateTenant($oTenant); + } + + return $bResult; + } + + /** + * @return array + */ + public function GetTimeZoneList() + { + return array( + CApi::I18N('ADMIN_PANEL/FORM_DEFAULT'), #0 + '(GMT -12:00) Eniwetok, Kwajalein, Dateline Time', #1 + '(GMT -11:00) Midway Island, Samoa', #2 + '(GMT -10:00) Hawaii', #3 + '(GMT -09:00) Alaska', #4 + '(GMT -08:00) Pacific Time (US & Canada), Tijuana', #5 + '(GMT -07:00) Arizona', #6 + '(GMT -07:00) Mountain Time (US & Canada)', #7 + '(GMT -06:00) Central America', #8 + '(GMT -06:00) Central Time (US & Canada)', #9 + '(GMT -06:00) Mexico City, Tegucigalpa', #10 + '(GMT -06:00) Saskatchewan', #11 + '(GMT -05:00) Indiana (East)', #12 + '(GMT -05:00) Eastern Time (US & Canada)', #13 + '(GMT -05:00) Bogota, Lima, Quito', #14 + '(GMT -04:00) Santiago', #15 + '(GMT -04:00) Caracas, La Paz', #16 + '(GMT -04:00) Atlantic Time (Canada)', #17 + '(GMT -03:30) Newfoundland', #18 + '(GMT -03:00) Greenland', #19 + '(GMT -03:00) Buenos Aires, Georgetown', #20 + '(GMT -03:00) Brasilia', #21 + '(GMT -02:00) Mid-Atlantic', #22 + '(GMT -01:00) Cape Verde Is.', #23 + '(GMT -01:00) Azores', #24 + '(GMT) Casablanca, Monrovia', #25 + '(GMT) Dublin, Edinburgh, Lisbon, London', #26 + '(GMT +01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna', #27 + '(GMT +01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague', #28 + '(GMT +01:00) Brussels, Copenhagen, Madrid, Paris', #29 + '(GMT +01:00) Sarajevo, Skopje, Sofija, Warsaw, Zagreb', #30 + '(GMT +01:00) West Central Africa', #31 + '(GMT +02:00) Athens, Istanbul, Minsk', #32 + '(GMT +02:00) Bucharest', #33 + '(GMT +02:00) Cairo', #34 + '(GMT +02:00) Harare, Pretoria', #35 + '(GMT +02:00) Helsinki, Riga, Tallinn, Vilnius', #36 + '(GMT +02:00) Israel, Jerusalem Standard Time', #37 + '(GMT +03:00) Baghdad', #38 + '(GMT +03:00) Arab, Kuwait, Riyadh', #39 + '(GMT +03:00) East Africa, Nairobi', #40 + '(GMT +03:00) Moscow, St. Petersburg, Volgograd', #41 + '(GMT +03:30) Tehran', #42 + '(GMT +04:00) Abu Dhabi, Muscat', #43 + '(GMT +04:00) Baku, Tbilisi, Yerevan', #44 + '(GMT +04:30) Kabul', #45 + '(GMT +05:00) Islamabad, Karachi, Sverdlovsk, Tashkent', #46 + '(GMT +05:30) Calcutta, Chennai, Mumbai, New Delhi, India Standard Time', #47 + '(GMT +05:45) Kathmandu, Nepal', #48 + '(GMT +06:00) Ekaterinburg', #49 + '(GMT +06:00) Almaty, North Central Asia', #50 + '(GMT +06:00) Astana, Dhaka', #51 + '(GMT +06:00) Sri Jayawardenepura, Sri Lanka', #52 + '(GMT +06:30) Rangoon', #53 + '(GMT +07:00) Bangkok, Novosibirsk, Hanoi, Jakarta', #54 + '(GMT +08:00) Krasnoyarsk', #55 + '(GMT +08:00) Beijing, Chongqing, Hong Kong SAR, Urumqi', #56 + '(GMT +08:00) Ulaan Bataar', #57 + '(GMT +08:00) Kuala Lumpur, Singapore', #58 + '(GMT +08:00) Perth, Western Australia', #59 + '(GMT +08:00) Taipei', #60 + '(GMT +09:00) Osaka, Sapporo, Tokyo, Irkutsk', #61 + '(GMT +09:00) Seoul, Korea Standard time', #62 + '(GMT +09:30) Adelaide, Central Australia', #63 + '(GMT +09:30) Darwin', #64 + '(GMT +10:00) Yakutsk', #65 + '(GMT +10:00) Brisbane, East Australia', #66 + '(GMT +10:00) Canberra, Melbourne, Sydney, Hobart', #67 + '(GMT +10:00) Guam, Port Moresby', #68 + '(GMT +10:00) Hobart, Tasmania', #69 + '(GMT +11:00) Vladivostok', #70 + '(GMT +11:00) Solomon Is., New Caledonia', #71 + '(GMT +12:00) Auckland, Wellington, Magadan', #72 + '(GMT +12:00) Fiji Islands, Kamchatka, Marshall Is.', #73 + '(GMT +13:00) Nuku\'alofa, Tonga' #74 + ); + } + + /** + * @return array + */ + public function GetSkinList() + { + return $this->oIntegratorApi->getThemeList(); + } + + /** + * @return array + */ + public function GetLangsList() + { + return $this->oIntegratorApi->getLanguageList(); + } + + /** + * @return array + */ + public function getTabList($oDomain) + { + return $this->oIntegratorApi->getTabList($oDomain); + } +} + diff --git a/adminpanel/modules/common/js/db.js b/adminpanel/modules/common/js/db.js index defc4360..21aed489 100644 --- a/adminpanel/modules/common/js/db.js +++ b/adminpanel/modules/common/js/db.js @@ -1,12 +1,12 @@ -$(function () { - $('#test_btn').click(function () { - $('#isTestConnection').val('1'); - this.form.submit(); - }); - $('#update_btn').click(function () { - PopUpWindow(AP_INDEX + '?pop&type=db&action=update'); - }); - $('#create_btn').click(function () { - PopUpWindow(AP_INDEX + '?pop&type=db&action=create'); - }); +$(function () { + $('#test_btn').click(function () { + $('#isTestConnection').val('1'); + this.form.submit(); + }); + $('#update_btn').click(function () { + PopUpWindow(AP_INDEX + '?pop&type=db&action=update'); + }); + $('#create_btn').click(function () { + PopUpWindow(AP_INDEX + '?pop&type=db&action=create'); + }); }); \ No newline at end of file diff --git a/adminpanel/modules/common/templates/main-edit-domain-general-webmail.php b/adminpanel/modules/common/templates/main-edit-domain-general-webmail.php index 9cd927d2..a4e52c61 100644 --- a/adminpanel/modules/common/templates/main-edit-domain-general-webmail.php +++ b/adminpanel/modules/common/templates/main-edit-domain-general-webmail.php @@ -1,67 +1,67 @@ -
- - - - - - - - - - - - - - - - - - - - -
- - - - - -
- - - - - -     - -
- - - - - -
- - - - - -
- Data->PrintCheckedValue('chAllowUsersAccessInterfaveSettings'); ?> /> - - -
- -
-
+
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + +     + +
+ + + + + +
+ + + + + +
+ Data->PrintCheckedValue('chAllowUsersAccessInterfaveSettings'); ?> /> + + +
+ +
+

\ No newline at end of file diff --git a/adminpanel/modules/common/templates/security.php b/adminpanel/modules/common/templates/security.php index 4182a308..2618f8c0 100644 --- a/adminpanel/modules/common/templates/security.php +++ b/adminpanel/modules/common/templates/security.php @@ -1,34 +1,34 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/adminpanel/modules/common/templates/social-aurora.php b/adminpanel/modules/common/templates/social-aurora.php index 56acdef3..ef4253e3 100644 --- a/adminpanel/modules/common/templates/social-aurora.php +++ b/adminpanel/modules/common/templates/social-aurora.php @@ -1,38 +1,38 @@ - - - Data->PrintCheckedValue('chSocialFacebookAllow') ?>/> - -
-
- -
-
- - - -
-
- -
- - - - - - Data->PrintCheckedValue('chSocialTwitterAllow') ?>/> - -
-
- -
-
- - - -
-
- -
- - + + + Data->PrintCheckedValue('chSocialFacebookAllow') ?>/> + +
+
+ +
+
+ + + +
+
+ +
+ + + + + + Data->PrintCheckedValue('chSocialTwitterAllow') ?>/> + +
+
+ +
+
+ + + +
+
+ +
+ + \ No newline at end of file diff --git a/adminpanel/modules/common/templates/social-footer.php b/adminpanel/modules/common/templates/social-footer.php index e7d53853..311e2055 100644 --- a/adminpanel/modules/common/templates/social-footer.php +++ b/adminpanel/modules/common/templates/social-footer.php @@ -1,7 +1,7 @@ - - -
- -
- + + +
+ +
+ \ No newline at end of file diff --git a/adminpanel/modules/common/templates/social-header.php b/adminpanel/modules/common/templates/social-header.php index e3346a2a..b9dce932 100644 --- a/adminpanel/modules/common/templates/social-header.php +++ b/adminpanel/modules/common/templates/social-header.php @@ -1,7 +1,7 @@ - - - -
-
- + + + +
+
+ \ No newline at end of file diff --git a/adminpanel/modules/common/templates/social.php b/adminpanel/modules/common/templates/social.php index d513d47d..abb75eba 100644 --- a/adminpanel/modules/common/templates/social.php +++ b/adminpanel/modules/common/templates/social.php @@ -1,55 +1,55 @@ -Data->getValue('Socials') as $sSocialKey => $SocialItem) { ?> - - - Data->ConvertBoolToChecked($SocialItem->SocialAllow) ?>/> - - - - - - - - - - - - - - - - - - - -HasApiKey){ ?> - - - - - - - - - - - -
- - - - - - - - -SupportedScopes as $iKey => $sScope) -{ -?> - Data->ConvertBoolToChecked(in_array($sScope, explode(' ', $SocialItem->SocialScopes))) ?>/> - - - - -  +Data->getValue('Socials') as $sSocialKey => $SocialItem) { ?> + + + Data->ConvertBoolToChecked($SocialItem->SocialAllow) ?>/> + + + + + + + + + + + + + + + + + + + +HasApiKey){ ?> + + + + + + + + + + + +
+ + + + + + + + +SupportedScopes as $iKey => $sScope) +{ +?> + Data->ConvertBoolToChecked(in_array($sScope, explode(' ', $SocialItem->SocialScopes))) ?>/> + + + + +  = this.Profiles[i].AtLeast; - break; - } - } - this.IE = (this.Name == 'Microsoft Internet Explorer' && this.Version < 9); - this.IE9 = (this.Name == 'Microsoft Internet Explorer' && this.Version >= 9); - this.Opera = (this.Name == "Opera"); - this.Mozilla = (this.Name == "Mozilla" || this.Name == "Firefox" || this.Name == "Netscape"); - this.Safari = (this.Name == 'Safari'); - this.Gecko = (this.Opera || this.Mozilla); - }; - - this.Profiles = [ - { - id: "Opera", - Criterion: window.opera, - AtLeast: 8, - Version: function() { - var start, end; - var r = navigator.userAgent; - var start1 = r.indexOf("Opera/"); - var start2 = r.indexOf("Opera "); - if (-1 == start1) { - start = start2 + 6; - end = r.length; - } else { - start = start1 + 6; - end = r.indexOf(" "); - } - r = parseFloat(r.slice(start, end)); - return r; - } - }, - { - id: "Safari", - Criterion: - ( - (navigator.appCodeName.toLowerCase() == "mozilla") && - (navigator.appName.toLowerCase() == "netscape") && - (navigator.product.toLowerCase() == "gecko") && - (navigator.userAgent.toLowerCase().indexOf("safari") != -1) - ), - AtLeast: 1.2, - Version: function() { - var r = navigator.userAgent; - return parseFloat(r.split("Version/").reverse().join(" ")); - } - }, - { - id: "Firefox", - Criterion: - ( - (navigator.appCodeName.toLowerCase() == "mozilla") && - (navigator.appName.toLowerCase() == "netscape") && - (navigator.product.toLowerCase() == "gecko") && - (navigator.userAgent.toLowerCase().indexOf("firefox") != -1) - ), - AtLeast: 1, - Version: function() { - var r = navigator.userAgent.split(" ").reverse().join(" "); - r = parseFloat(r.slice(r.indexOf("/")+1,r.indexOf(" "))); - return r; - } - }, - { - id: "Netscape", - Criterion: - ( - (navigator.appCodeName.toLowerCase() == "mozilla") && - (navigator.appName.toLowerCase() == "netscape") && - (navigator.product.toLowerCase() == "gecko") && - (navigator.userAgent.toLowerCase().indexOf("netscape") != -1) - ), - AtLeast: 7, - Version: function() { - var r = navigator.userAgent.split(" ").reverse().join(" "); - r = parseFloat(r.slice(r.indexOf("/")+1,r.indexOf(" "))); - return r; - } - }, - { - id: "Mozilla", - Criterion: - ( - (navigator.appCodeName.toLowerCase() == "mozilla") && - (navigator.appName.toLowerCase() == "netscape") && - (navigator.product.toLowerCase() == "gecko") && - (navigator.userAgent.toLowerCase().indexOf("mozilla") != -1) - ), - AtLeast: 1, - Version: function() { - var r = navigator.userAgent; - return parseFloat(r.split("Firefox/").reverse().join(" ")); - } - }, - { - id: "Microsoft Internet Explorer", - Criterion: - ( - (navigator.appName.toLowerCase() == "microsoft internet explorer") && - (navigator.appVersion.toLowerCase().indexOf("msie") !== 0) && - (navigator.userAgent.toLowerCase().indexOf("msie") !== 0) && - (!window.opera) - ), - AtLeast: 5, - Version: function() { - var r = navigator.userAgent.toLowerCase(); - r = parseFloat(r.slice(r.indexOf("msie")+4,r.indexOf(";",r.indexOf("msie")+4))); - return r; - } - } - ]; - - this.Init(); -} - -var Browser = new CBrowser(); - -function CreateChild(parent, tagName) { - var node = document.createElement(tagName); - parent.appendChild(node); - return node; -} - -function CreateChildWithAttrs(parent, tagName, arAttrs) -{ - var i, t, key, val, node, attrsLen, strAttrs; - if (Browser.IE) { - strAttrs = ''; - attrsLen = arAttrs.length; - for (i = attrsLen - 1; i >= 0; i--) { - t = arAttrs[i]; - key = t[0]; - val = t[1]; - strAttrs += ' ' + key + '="' + val + '"'; - } - tagName = '<' + tagName + strAttrs + '>'; - node = document.createElement(tagName); - } else { - node = document.createElement(tagName); - attrsLen = arAttrs.length; - for (i = attrsLen - 1; i >= 0; i--) { - t = arAttrs[i]; - key = t[0]; - val = t[1]; - node.setAttribute(key, val); - } - } - parent.appendChild(node); - return node; -} - -function GetWidth() { - var width = 1024; - if (document.documentElement && document.documentElement.clientWidth) - { - width = document.documentElement.clientWidth; - } - else if (document.body.clientWidth) - { - width = document.body.clientWidth; - } - else if (self.innerWidth) - { - width = self.innerWidth; - } - return width; -} - -/* for control placement and displaying of information block */ -function CInformation(cont, cls) { - this._mainContainer = cont; - this._containerClass = cls; -} - -CInformation.prototype = { - Show: function () { - this._mainContainer.className = this._containerClass; - }, - - Hide: function () { - this._mainContainer.className = 'wm_hide'; - }, - - Resize: function () { - var tbl = this._mainContainer; - tbl.style.width = 'auto'; - var offsetWidth = tbl.offsetWidth; - var width = GetWidth(); - - var tblLeft = Math.round(width / 2 - offsetWidth / 2); - tbl.style.left = tblLeft + 'px'; - /* tbl.style.top = this.GetScrollY() + 'px'; */ - }/* , - - GetScrollY: function() { - var scrollY = 0; - if (document.body && typeof document.body.scrollTop != "undefined") { - scrollY += document.body.scrollTop; - if (scrollY === 0 && document.body.parentNode && typeof document.body.parentNode != "undefined") { - scrollY += document.body.parentNode.scrollTop; - } - } - else if (typeof window.pageXOffset != "undefined") { - scrollY += window.pageYOffset; - } - return scrollY; - } */ -}; - -function CError(name) -{ - this._name = name; - this._containerObj = null; - this._messageObj = null; - this._controlObj = null; - this._fadeObj = null; - this._delay = 10000; - - this.Build = function () - { - var tbl, tr, td, div, shadowDiv, aDiv, infoDiv, bDiv, imageDiv, closeImageDiv, obj; - tbl = CreateChildWithAttrs(document.body, 'table', [['class', 'wm_hide']]); - tr = tbl.insertRow(0); - td = tr.insertCell(0); - div = CreateChildWithAttrs(td, 'div', [['class', 'wm_info_block']]); - shadowDiv = CreateChildWithAttrs(div, 'div', [['class', 'wm_shadow']]); - aDiv = CreateChildWithAttrs(shadowDiv, 'div', [['class', 'a']]); - aDiv.innerHTML = ' '; - infoDiv = CreateChildWithAttrs(div, 'div', [['class', 'wm_info_message']]); - aDiv = CreateChildWithAttrs(div, 'div', [['class', 'a']]); - aDiv.innerHTML = ' '; - bDiv = CreateChildWithAttrs(div, 'div', [['class', 'b']]); - bDiv.innerHTML = ' '; - this._containerObj = tbl; - CreateChildWithAttrs(infoDiv, 'div', [['class', 'wm_info_image']]); - this._messageObj = CreateChild(infoDiv, 'span'); - closeImageDiv = CreateChildWithAttrs(infoDiv, 'div', [['class', 'wm_close_info_image wm_control']]); - obj = this; - closeImageDiv.onclick = function () { - obj.Hide(); - }; - this._controlObj = new CInformation(tbl, 'wm_information wm_error_information'); - }; -} - -function CReport(name) -{ - this._name = name; - this._containerObj = null; - this._messageObj = null; - this._controlObj = null; - this._fadeObj = null; - this._delay = 5000; - - this.Build = function () - { - var tbl, tr, td, div, shadowDiv, aDiv, infoDiv, bDiv; - tbl = CreateChildWithAttrs(document.body, 'table', [['class', 'wm_hide']]); - tr = tbl.insertRow(0); - td = tr.insertCell(0); - div = CreateChildWithAttrs(td, 'div', [['class', 'wm_info_block']]); - shadowDiv = CreateChildWithAttrs(div, 'div', [['class', 'wm_shadow']]); - aDiv = CreateChildWithAttrs(shadowDiv, 'div', [['class', 'a']]); - aDiv.innerHTML = ' '; - infoDiv = CreateChildWithAttrs(div, 'div', [['class', 'wm_info_message']]); - aDiv = CreateChildWithAttrs(div, 'div', [['class', 'a']]); - aDiv.innerHTML = ' '; - bDiv = CreateChildWithAttrs(div, 'div', [['class', 'b']]); - bDiv.innerHTML = ' '; - this._containerObj = tbl; - this._messageObj = infoDiv; - this._controlObj = new CInformation(tbl, 'wm_information wm_report_information'); - }; -} - -function CInfo(name) { - this._name = name; - this._containerObj = null; - this._messageObj = null; - this._controlObj = null; - this._fadeObj = null; - this._delay = 5000; - - this.Build = function () { - var tbl, tr, td, div, shadowDiv, aDiv, infoDiv, bDiv; - tbl = CreateChildWithAttrs(document.body, 'table', [['class', 'wm_hide']]); - tr = tbl.insertRow(0); - td = tr.insertCell(0); - div = CreateChildWithAttrs(td, 'div', [['class', 'wm_info_block']]); - shadowDiv = CreateChildWithAttrs(div, 'div', [['class', 'wm_shadow']]); - aDiv = CreateChildWithAttrs(shadowDiv, 'div', [['class', 'a']]); - aDiv.innerHTML = ' '; - infoDiv = CreateChildWithAttrs(div, 'div', [['class', 'wm_info_message']]); - aDiv = CreateChildWithAttrs(div, 'div', [['class', 'a']]); - aDiv.innerHTML = ' '; - bDiv = CreateChildWithAttrs(div, 'div', [['class', 'b']]); - bDiv.innerHTML = ' '; - this._containerObj = tbl; - this._messageObj = infoDiv; - this._controlObj = new CInformation(tbl, 'wm_information wm_status_information'); - }; -} - -var iReportTimeOut = 0; -var ReportPrototype = { - Show: function (msg, priorDelay, bUseMultipleMessage) { - bUseMultipleMessage = bUseMultipleMessage || false; - - if (!bUseMultipleMessage) - { - this._messageObj.innerHTML = msg; - } - else if (bUseMultipleMessage) - { - this._messageObj.innerHTML += ('' === this._messageObj.innerHTML) ? msg : - '
' + msg; - } - - this._controlObj.Show(); - this._controlObj.Resize(); - window.clearTimeout(iReportTimeOut); - if (null !== this._fadeObj && !bUseMultipleMessage) { - var interval = (priorDelay) ? - this._fadeObj.Go(this._containerObj, priorDelay) : - this._fadeObj.Go(this._containerObj, this._delay); - - if (this._name) { - iReportTimeOut = setTimeout(this._name + '.Hide()', interval); - } - } else { - if (this._name) { - iReportTimeOut = setTimeout(this._name + '.Hide()', - (priorDelay) ? priorDelay : this._delay); - } - } - }, - - SetFade: function (fadeObj) { - this._fadeObj = fadeObj; - }, - - Hide: function () { - this._controlObj.Hide(); - if (null !== this._fadeObj) - { - this._fadeObj.RemoveOpacity(); - } - this._messageObj.innerHTML = ''; - }, - - Resize: function () { - this._controlObj.Resize(); - } -}; - -CInfo.prototype = ReportPrototype; -CReport.prototype = ReportPrototype; -CError.prototype = ReportPrototype; - -function CFadeEffect(name) { - this._name = name; - this._elem = null; - this._duration = 600; -} - -CFadeEffect.prototype = { - Go: function (elem, delay) { - this._elem = elem; - - setTimeout((function (elem, duration) { - return function () { - $(elem).fadeOut(duration); - }; - })(this._elem, this._duration), delay); - - return this._duration + delay; - }, - - RemoveOpacity: function () { - $(this._elem).css({'opacity': 1}); - } -}; - -var MsgBox = { - _fadeObj: null, - _errorObj: null, - _reportObj: null, - _infoObj: null, - _skin: 'adminpanel', - - Init: function () { - this._skin = '.'; - if (this._fadeObj === null) - { - this._fadeObj = new CFadeEffect('MsgBox._fadeObj'); - } - if (this._errorObj === null) - { - this._errorObj = new CError('MsgBox._errorObj'); - this._errorObj.Build(this._skin); - this._errorObj.SetFade(this._fadeObj); - } - if (this._reportObj === null) - { - this._reportObj = new CReport('MsgBox._reportObj'); - this._reportObj.Build(); - this._reportObj.SetFade(this._fadeObj); - } - if (this._infoObj === null) - { - this._infoObj = new CInfo('MsgBox._infoObj'); - this._infoObj.Build(); - this._infoObj.SetFade(this._fadeObj); - } - }, - - /* - * type = 0 - info - * type = 1 - report - * type = 2 - error - */ - Show: function (msg, type, delay, bUseMultipleMessage) { - this.Init(); - if (!type) - { - type = 0; - } - switch (type) { - case 0: - this._infoObj.Show(msg, delay, bUseMultipleMessage); - break; - case 1: - this._reportObj.Show(msg, delay, bUseMultipleMessage); - break; - case 2: - this._errorObj.Show(msg, delay, bUseMultipleMessage); - break; - } - } -}; - -String.prototype.trim = function () { - return (this !== null && this !== undefined) ? - this.replace(/^\s+/, '').replace(/\s+$/, '') : this; -}; - -function ShowError(errorMsg, errorCode) { - MsgBox.Show('Error on client side - Code: ' + errorCode + '
' + errorMsg, 2); -} - -function PopUpWindow(url) { - var shown = window.open(url, 'Popup', - 'left=50,top=150, toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,'+ - 'copyhistory=no,width=750,height=500'); - shown.focus(); - return false; -} - -function GoToLocation(url) { - window.location.href = url; -} - -function GetHeight() { - var height = 768; - if (self.innerHeight) - { - height = self.innerHeight; - } - else if (document.documentElement && document.documentElement.clientHeight) - { - height = document.documentElement.clientHeight; - } - else if (document.body.clientHeight) - { - height = document.body.clientHeight; - } - return height; -} - -function GetBounds(object) { - if (object === null || object === undefined) - { - return {Left: 0, Top: 0, Width: 0, Height: 0}; - } - var left = object.offsetLeft; - var top = object.offsetTop; - for (var parent = object.offsetParent; parent; parent = parent.offsetParent) { - left += parent.offsetLeft; - top += parent.offsetTop; - } - return {Left: left, Top: top, Width: object.offsetWidth, Height: object.offsetHeight}; -} - -function OnlineMsgError(text) { - MsgBox.Show(text, 2, null, true); -} - -function OnlineMsgInfo(text) { - MsgBox.Show(text, 1); -} - -function OnlineLoadInfo(text) { - MsgBox.Show(text, 0, 20000); -} - -var Tip = { - _container: null, - _message: null, - _base: '', - _initialized: false, - - _init: function () { - if (this._initialized) - { - return; - } - this._container = CreateChild(document.body, 'table'); - this._container.className = 'wm_hide'; - var tr = this._container.insertRow(0); - var td = tr.insertCell(0); - td.className = 'wm_tip_arrow'; - this._message = tr.insertCell(1); - this._message.className = 'wm_tip_info'; - this._initialized = true; - }, - - SetMessageText: function(text) { - this._message.innerHTML = text; - }, - - SetCoord: function(element) { - var bounds = GetBounds(element); - this._container.style.top = (bounds.Top + bounds.Height/2 - 16) + 'px'; - this._container.style.left = (bounds.Left + bounds.Width - 5) + 'px'; - }, - - Show: function(text, element, base) { - this._init(); - this.SetMessageText(text); - this.SetCoord(element); - this._base = base; - this._container.className = 'wm_tip'; - }, - - Hide: function(base) { - this._init(); - if (this._base === base || this._base === '') - { - this._container.className = 'wm_hide'; - } - } -}; - -function ResizeMainError() -{ - var mainErrorObj = document.getElementById('mainIdObj'); - if (mainErrorObj) - { - mainErrorObj.style.width = 'auto'; - mainErrorObj.style.left = Math.round( - (GetWidth() / 2) - (mainErrorObj.offsetWidth / 2)) + 'px'; - } -} - -var _seeToolTip = 0; -var l = 0; -var t = 0; -var IE = document.all ? true : false; -var tooltip = document.createElement("div"); -tooltip.id = 'tooltip'; - -function getMouseXY(e) { - try { - if (IE) { - l = event.clientX + document.documentElement.scrollLeft; - t = event.clientY + document.documentElement.scrollTop; - } else { - l = e.pageX; - t = e.pageY; - } - tooltip.style.left = l + "px"; - tooltip.style.top = t + "px"; - return true; - }catch(errorMsg) { - ShowError(errorMsg, '103'); - } -} - -function AddToolTip(tooltip_text) { - try { - if (window.event) - { - getMouseXY(window.event); - } - document.onmousemove = getMouseXY; - document.body.appendChild(tooltip); - tooltip.innerHTML = tooltip_text; - _seeToolTip++; - } catch(errorMsg) { - ShowError(errorMsg, '104'); - } -} - -function RemoveToolTip() { - try { - document.onmousemove = ''; - if (tooltip && _seeToolTip > 0) { - _seeToolTip--; - document.body.removeChild(tooltip); - } - } catch(errorMsg) { - ShowError(errorMsg, '105'); - } -} - -function JAddToolTip(sId, sText) -{ - var oLabel = $('#' + sId); - if (oLabel.length) - { - oLabel.addClass('DottedText'); - oLabel.mouseover(function() {AddToolTip(sText);}); - oLabel.mouseout(function() {RemoveToolTip();}); - } -} - -function SetDisabled(obj, isDisabled, withLabel) { - if (obj) { - isDisabled = (typeof isDisabled == 'undefined') ? false : isDisabled; - if (isDisabled) { -// if (!obj.type || obj.type == 'checkbox' || obj.type == 'radio' || obj.type == 'button' || obj.type == 'submit') {} -// else { -// obj.style.background = "#ddd"; -// } - if (obj.type && obj.type !== 'checkbox' && obj.type !== 'radio' && obj.type !== 'button' || obj.type !== 'button') - { - obj.style.background = "#ddd"; - } - - obj.disabled = true; - }else { - obj.disabled = false; - if (obj.type && obj.type !== 'checkbox' && obj.type !== 'radio' && obj.type !== 'button' || obj.type !== 'button') - { - obj.style.background = "#fff"; - } -// if (!obj.type || obj.type == 'checkbox' || obj.type == 'radio' || obj.type == 'button' || obj.type == 'submit') {} -// else { -// obj.style.background = "#fff"; -// } - } - - withLabel =(typeof withLabel == 'undefined') ? false : withLabel; - if (withLabel) { - var _l = document.getElementById(obj.id + "_label"); - if (_l) { - _l.style.color = (isDisabled) ? "#aaaaaa" : "#000000"; - } - } - } -} - -function SetDisabledArray(chId, idsArray) -{ - var chObj = document.getElementById(chId); - if (chObj) { - for (var aId in idsArray) - { - if (idsArray.hasOwnProperty(aId)) - { - SetDisabled(document.getElementById(idsArray[aId]), !chObj.checked, true); - } - } - } -} - -function WindowForceResize() -{ - $(window).trigger('resize'); -} - -function DeleteSelectedFromList(sListId) -{ - $('#' + sListId + ' option:selected').remove(); -} - -function AddUserToList(sFromId, sListId, sDomain) -{ - var oFromInput = $('#' + sFromId); - var oList = $('#' + sListId); - if (oFromInput && oList) - { - var sValue = oFromInput.val(); - if (sValue && 0 < sValue.length) - { - if (typeof(sDomain) != 'undefined') - { - sValue = sValue + '@' + sDomain; - } - $('
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ : +
+ : +
+ : +
+ : +
+ : +
+ : +
+ : + + + + + , + + + () + + + + + +
+
+
+
+
diff --git a/templates/views/Popups/AccountCreatePopupViewModel.html b/templates/views/Popups/AccountCreatePopupViewModel.html index 16bcc1a0..c3776198 100644 --- a/templates/views/Popups/AccountCreatePopupViewModel.html +++ b/templates/views/Popups/AccountCreatePopupViewModel.html @@ -1,63 +1,63 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/Calendar/CalendarPopupViewModel.html b/templates/views/Popups/Calendar/CalendarPopupViewModel.html index e2524de1..cb7c9872 100644 --- a/templates/views/Popups/Calendar/CalendarPopupViewModel.html +++ b/templates/views/Popups/Calendar/CalendarPopupViewModel.html @@ -1,26 +1,26 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/Calendar/EditRecurrenceEventPopupViewModel.html b/templates/views/Popups/Calendar/EditRecurrenceEventPopupViewModel.html index ded8b667..4eb355fa 100644 --- a/templates/views/Popups/Calendar/EditRecurrenceEventPopupViewModel.html +++ b/templates/views/Popups/Calendar/EditRecurrenceEventPopupViewModel.html @@ -1,11 +1,11 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/Calendar/EventPopupViewModel.html b/templates/views/Popups/Calendar/EventPopupViewModel.html index 630a0b1d..8ab54574 100644 --- a/templates/views/Popups/Calendar/EventPopupViewModel.html +++ b/templates/views/Popups/Calendar/EventPopupViewModel.html @@ -1,281 +1,281 @@ -
-
- - +
+
+ + diff --git a/templates/views/Popups/Calendar/GetLinkPopupViewModel.html b/templates/views/Popups/Calendar/GetLinkPopupViewModel.html index da3a04cb..cd33c24c 100644 --- a/templates/views/Popups/Calendar/GetLinkPopupViewModel.html +++ b/templates/views/Popups/Calendar/GetLinkPopupViewModel.html @@ -1,36 +1,36 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/Calendar/SharePopupViewModel.html b/templates/views/Popups/Calendar/SharePopupViewModel.html index 46e83480..0ff8d55d 100644 --- a/templates/views/Popups/Calendar/SharePopupViewModel.html +++ b/templates/views/Popups/Calendar/SharePopupViewModel.html @@ -1,68 +1,68 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/ConfirmPopupViewModel.html b/templates/views/Popups/ConfirmPopupViewModel.html index f535ca66..d857d678 100644 --- a/templates/views/Popups/ConfirmPopupViewModel.html +++ b/templates/views/Popups/ConfirmPopupViewModel.html @@ -1,11 +1,11 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/ContactCreatePopupViewModel.html b/templates/views/Popups/ContactCreatePopupViewModel.html index 190a9cb9..9683df80 100644 --- a/templates/views/Popups/ContactCreatePopupViewModel.html +++ b/templates/views/Popups/ContactCreatePopupViewModel.html @@ -1,50 +1,50 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/FetcherAddPopupViewModel.html b/templates/views/Popups/FetcherAddPopupViewModel.html index 1baef56d..8ac38793 100644 --- a/templates/views/Popups/FetcherAddPopupViewModel.html +++ b/templates/views/Popups/FetcherAddPopupViewModel.html @@ -1,55 +1,55 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/FileStorage/FileStoragePopupViewModel.html b/templates/views/Popups/FileStorage/FileStoragePopupViewModel.html index c9f4471e..a240f5e9 100644 --- a/templates/views/Popups/FileStorage/FileStoragePopupViewModel.html +++ b/templates/views/Popups/FileStorage/FileStoragePopupViewModel.html @@ -1,23 +1,23 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/FileStorage/FolderCreatePopupViewModel.html b/templates/views/Popups/FileStorage/FolderCreatePopupViewModel.html index 99ff1749..299fa2b3 100644 --- a/templates/views/Popups/FileStorage/FolderCreatePopupViewModel.html +++ b/templates/views/Popups/FileStorage/FolderCreatePopupViewModel.html @@ -1,20 +1,20 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/FileStorage/LinkCreatePopupViewModel.html b/templates/views/Popups/FileStorage/LinkCreatePopupViewModel.html index e472f42a..ed5aa864 100644 --- a/templates/views/Popups/FileStorage/LinkCreatePopupViewModel.html +++ b/templates/views/Popups/FileStorage/LinkCreatePopupViewModel.html @@ -1,26 +1,26 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/FileStorage/RenamePopupViewModel.html b/templates/views/Popups/FileStorage/RenamePopupViewModel.html index 3748490f..aee773a6 100644 --- a/templates/views/Popups/FileStorage/RenamePopupViewModel.html +++ b/templates/views/Popups/FileStorage/RenamePopupViewModel.html @@ -1,21 +1,21 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/FileStorage/SharePopupViewModel.html b/templates/views/Popups/FileStorage/SharePopupViewModel.html index af6bba0f..f81880a1 100644 --- a/templates/views/Popups/FileStorage/SharePopupViewModel.html +++ b/templates/views/Popups/FileStorage/SharePopupViewModel.html @@ -1,19 +1,19 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/FolderCreatePopupViewModel.html b/templates/views/Popups/FolderCreatePopupViewModel.html index 0fe798ab..ad761648 100644 --- a/templates/views/Popups/FolderCreatePopupViewModel.html +++ b/templates/views/Popups/FolderCreatePopupViewModel.html @@ -1,25 +1,25 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/FolderSystemPopupViewModel.html b/templates/views/Popups/FolderSystemPopupViewModel.html index 1c113de0..a6aa6d08 100644 --- a/templates/views/Popups/FolderSystemPopupViewModel.html +++ b/templates/views/Popups/FolderSystemPopupViewModel.html @@ -1,38 +1,38 @@ -
- +
+ \ No newline at end of file diff --git a/templates/views/Popups/PlayerPopupViewModel.html b/templates/views/Popups/PlayerPopupViewModel.html index 3793a46e..6878196d 100644 --- a/templates/views/Popups/PlayerPopupViewModel.html +++ b/templates/views/Popups/PlayerPopupViewModel.html @@ -1,4 +1,4 @@ -
- - - +
+ + + diff --git a/templates/views/Settings/AccountFilterPartAction.html b/templates/views/Settings/AccountFilterPartAction.html index e63aa5d8..194444ff 100644 --- a/templates/views/Settings/AccountFilterPartAction.html +++ b/templates/views/Settings/AccountFilterPartAction.html @@ -1,12 +1,12 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/templates/views/Settings/AccountFilterPartCondition.html b/templates/views/Settings/AccountFilterPartCondition.html index e9a927cd..0e1516d6 100644 --- a/templates/views/Settings/AccountFilterPartCondition.html +++ b/templates/views/Settings/AccountFilterPartCondition.html @@ -1,12 +1,12 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/templates/views/Settings/AccountFilterPartField.html b/templates/views/Settings/AccountFilterPartField.html index 141557c7..9e15492a 100644 --- a/templates/views/Settings/AccountFilterPartField.html +++ b/templates/views/Settings/AccountFilterPartField.html @@ -1,12 +1,12 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/templates/views/Settings/AccountFilterPartFolder.html b/templates/views/Settings/AccountFilterPartFolder.html index 50a0e7c5..ad0623eb 100644 --- a/templates/views/Settings/AccountFilterPartFolder.html +++ b/templates/views/Settings/AccountFilterPartFolder.html @@ -1,13 +1,13 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/templates/views/Settings/AccountFolderItem.html b/templates/views/Settings/AccountFolderItem.html index e04d3cf5..27b65cc1 100644 --- a/templates/views/Settings/AccountFolderItem.html +++ b/templates/views/Settings/AccountFolderItem.html @@ -1,25 +1,25 @@ -
- - - - - - - - - - - - - - - -
-
+
+ + + + + + + + + + + + + + + +
+
diff --git a/templates/views/Settings/AccountFolderItemMovedWithMouse.html b/templates/views/Settings/AccountFolderItemMovedWithMouse.html index 4249a6d9..705834a7 100644 --- a/templates/views/Settings/AccountFolderItemMovedWithMouse.html +++ b/templates/views/Settings/AccountFolderItemMovedWithMouse.html @@ -1,21 +1,21 @@ - - - - - - - - - - - - - - - -
-
-
- + + + + + + + + + + + + + + + +
+
+
+ diff --git a/templates/views/Settings/IdentityPropertiesViewModel.html b/templates/views/Settings/IdentityPropertiesViewModel.html index c7bc7c2f..11be22c5 100644 --- a/templates/views/Settings/IdentityPropertiesViewModel.html +++ b/templates/views/Settings/IdentityPropertiesViewModel.html @@ -1,41 +1,41 @@ -
-
- -
-
- - -
-
-
- - -
-
- - -
- -
- -
- - - -
-
+
+
+ +
+
+ + +
+
+
+ + +
+
+ + +
+ +
+ +
+ + + +
+
diff --git a/templates/views/Settings/SettingsViewModel.html b/templates/views/Settings/SettingsViewModel.html index 8969caec..5e360d79 100644 --- a/templates/views/Settings/SettingsViewModel.html +++ b/templates/views/Settings/SettingsViewModel.html @@ -1,28 +1,28 @@ -
- -
-
-
- -
-
-
+
+ +
+
+
+ +
+
+
\ No newline at end of file