NCSettings.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. //
  2. // NCSettings.m
  3. // Nextcloud
  4. //
  5. // Created by Marino Faggiana on 24/11/14.
  6. // Copyright (c) 2014 Marino Faggiana. All rights reserved.
  7. //
  8. // Author Marino Faggiana <marino.faggiana@nextcloud.com>
  9. //
  10. // This program is free software: you can redistribute it and/or modify
  11. // it under the terms of the GNU General Public License as published by
  12. // the Free Software Foundation, either version 3 of the License, or
  13. // (at your option) any later version.
  14. //
  15. // This program is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. // GNU General Public License for more details.
  19. //
  20. // You should have received a copy of the GNU General Public License
  21. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. //
  23. #import "NCSettings.h"
  24. #import "CCAdvanced.h"
  25. #import "CCManageAccount.h"
  26. #import "CCManageAutoUpload.h"
  27. #import "NCManageEndToEndEncryption.h"
  28. #import "NCBridgeSwift.h"
  29. #import "NSNotificationCenter+MainThread.h"
  30. #import <LocalAuthentication/LocalAuthentication.h>
  31. #import <TOPasscodeViewController/TOPasscodeViewController.h>
  32. #define alertViewEsci 1
  33. #define alertViewAzzeraCache 2
  34. @interface NCSettings () <TOPasscodeSettingsViewControllerDelegate, TOPasscodeViewControllerDelegate>
  35. {
  36. AppDelegate *appDelegate;
  37. TOPasscodeViewController *passcodeViewController;
  38. TOPasscodeSettingsViewController *passcodeSettingsViewController;
  39. }
  40. @end
  41. @implementation NCSettings
  42. - (void)initializeForm
  43. {
  44. XLFormDescriptor *form = [XLFormDescriptor formDescriptor];
  45. XLFormSectionDescriptor *section;
  46. XLFormRowDescriptor *row;
  47. //NSInteger serverVersionMajor = [[NCManageDatabase shared] getCapabilitiesServerIntWithAccount:appDelegate.account elements:NCElementsJSON.shared.capabilitiesVersionMajor];
  48. form.rowNavigationOptions = XLFormRowNavigationOptionNone;
  49. // Section AUTO UPLOAD OF CAMERA IMAGES ----------------------------
  50. section = [XLFormSectionDescriptor formSection];
  51. [form addFormSection:section];
  52. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"autoUpload" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_settings_autoupload_", nil)];
  53. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  54. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  55. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  56. [row.cellConfig setObject:[[UIImage imageNamed:@"autoUpload"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  57. row.action.viewControllerClass = [CCManageAutoUpload class];
  58. [section addFormRow:row];
  59. // Section : PRIVACY --------------------------------------------------------------
  60. section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_privacy_", nil)];
  61. [form addFormSection:section];
  62. // Lock active YES/NO
  63. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"bloccopasscode" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_lock_not_active_", nil)];
  64. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  65. [row.cellConfig setObject:[[UIImage imageNamed:@"lock_open"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  66. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  67. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  68. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  69. //[row.cellConfig setObject:@(UITableViewCellAccessoryDisclosureIndicator) forKey:@"accessoryType"];
  70. row.action.formSelector = @selector(passcode:);
  71. [section addFormRow:row];
  72. // Enable Touch ID
  73. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"enableTouchDaceID" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_enable_touch_face_id_", nil)];
  74. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  75. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  76. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  77. [section addFormRow:row];
  78. // Lock no screen
  79. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"notPasscodeAtStart" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_lock_protection_no_screen_", nil)];
  80. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  81. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  82. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  83. [section addFormRow:row];
  84. // Privacy screen
  85. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"privacyScreen" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_privacy_screen_", nil)];
  86. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  87. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  88. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  89. [section addFormRow:row];
  90. // Section : E2EEncryption --------------------------------------------------------------
  91. section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_e2e_settings_title_", nil)];
  92. [form addFormSection:section];
  93. // EndToEnd Encryption
  94. NSString *title = [NSString stringWithFormat:@"%@",NSLocalizedString(@"_e2e_settings_", nil)];
  95. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"e2eEncryption" rowType:XLFormRowDescriptorTypeButton title:title];
  96. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  97. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  98. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  99. [row.cellConfig setObject:[[UIImage imageNamed:@"lock"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  100. row.action.viewControllerClass = [NCManageEndToEndEncryption class];
  101. [section addFormRow:row];
  102. // Section Advanced -------------------------------------------------
  103. section = [XLFormSectionDescriptor formSection];
  104. [form addFormSection:section];
  105. // Advanced
  106. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"advanced" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_advanced_", nil)];
  107. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  108. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  109. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  110. [row.cellConfig setObject:[[UIImage imageNamed:@"gear"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  111. row.action.viewControllerClass = [CCAdvanced class];
  112. [section addFormRow:row];
  113. // Section : INFORMATION ------------------------------------------------
  114. section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_information_", nil)];
  115. [form addFormSection:section];
  116. // Acknowledgements
  117. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"buttonLeftAligned" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_acknowledgements_", nil)];
  118. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  119. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  120. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  121. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  122. [row.cellConfig setObject:[[UIImage imageNamed:@"acknowledgements"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  123. row.action.formBlock = ^(XLFormRowDescriptor * sender){
  124. [self performSegueWithIdentifier:@"AcknowledgementsSegue" sender:sender];
  125. [self deselectFormRow:sender];
  126. };
  127. [section addFormRow:row];
  128. if (!NCBrandOptions.shared.disable_crash_service) {
  129. // Privacy and Legal Policy
  130. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"privacy" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_privacy_legal_", nil)];
  131. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  132. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  133. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  134. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  135. [row.cellConfig setObject:[[UIImage imageNamed:@"shield.checkerboard"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  136. row.action.formSelector = @selector(privacy:);
  137. [section addFormRow:row];
  138. // Source code
  139. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"sourcecode" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_source_code_", nil)];
  140. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  141. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  142. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  143. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  144. [row.cellConfig setObject:[[UIImage imageNamed:@"gitHub"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  145. row.action.formSelector = @selector(sourceCode:);
  146. [section addFormRow:row];
  147. }
  148. self.tableView.showsVerticalScrollIndicator = NO;
  149. self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 35, 0);
  150. self.form = form;
  151. }
  152. // MARK: - View Life Cycle
  153. - (void)viewDidLoad
  154. {
  155. [super viewDidLoad];
  156. self.title = NSLocalizedString(@"_settings_", nil);
  157. self.view.backgroundColor = UIColor.systemGroupedBackgroundColor;
  158. self.tableView.backgroundColor = UIColor.systemGroupedBackgroundColor;
  159. appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
  160. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidEnterBackground) name:NCGlobal.shared.notificationCenterApplicationDidEnterBackground object:nil];
  161. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(initialize) name:NCGlobal.shared.notificationCenterInitialize object:nil];
  162. [self initializeForm];
  163. [self reloadForm];
  164. }
  165. - (void)viewWillAppear:(BOOL)animated
  166. {
  167. [super viewWillAppear:animated];
  168. appDelegate.activeViewController = self;
  169. }
  170. #pragma mark - NotificationCenter
  171. - (void)initialize
  172. {
  173. [self initializeForm];
  174. [self reloadForm];
  175. }
  176. - (void)applicationDidEnterBackground
  177. {
  178. if (passcodeViewController.view.window != nil) {
  179. [passcodeViewController dismissViewControllerAnimated:true completion:nil];
  180. }
  181. if (passcodeSettingsViewController.view.window != nil) {
  182. [passcodeSettingsViewController dismissViewControllerAnimated:true completion:nil];
  183. }
  184. }
  185. #pragma mark -
  186. - (void)reloadForm
  187. {
  188. self.form.delegate = nil;
  189. // ------------------------------------------------------------------
  190. XLFormRowDescriptor *rowBloccoPasscode = [self.form formRowWithTag:@"bloccopasscode"];
  191. XLFormRowDescriptor *rowNotPasscodeAtStart = [self.form formRowWithTag:@"notPasscodeAtStart"];
  192. XLFormRowDescriptor *rowEnableTouchDaceID = [self.form formRowWithTag:@"enableTouchDaceID"];
  193. XLFormRowDescriptor *rowPrivacyScreen = [self.form formRowWithTag:@"privacyScreen"];
  194. // ------------------------------------------------------------------
  195. if ([[CCUtility getPasscode] length]) {
  196. rowBloccoPasscode.title = NSLocalizedString(@"_lock_active_", nil);
  197. [rowBloccoPasscode.cellConfig setObject:[[UIImage imageNamed:@"lock"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  198. } else {
  199. rowBloccoPasscode.title = NSLocalizedString(@"_lock_not_active_", nil);
  200. [rowBloccoPasscode.cellConfig setObject:[[UIImage imageNamed:@"lock_open"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  201. }
  202. if ([CCUtility getEnableTouchFaceID]) [rowEnableTouchDaceID setValue:@1]; else [rowEnableTouchDaceID setValue:@0];
  203. if ([CCUtility getNotPasscodeAtStart]) [rowNotPasscodeAtStart setValue:@1]; else [rowNotPasscodeAtStart setValue:@0];
  204. if ([CCUtility getPrivacyScreenEnabled]) [rowPrivacyScreen setValue:@1]; else [rowPrivacyScreen setValue:@0];
  205. // -----------------------------------------------------------------
  206. [self.tableView reloadData];
  207. self.form.delegate = self;
  208. }
  209. - (void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)rowDescriptor oldValue:(id)oldValue newValue:(id)newValue
  210. {
  211. [super formRowDescriptorValueHasChanged:rowDescriptor oldValue:oldValue newValue:newValue];
  212. if ([rowDescriptor.tag isEqualToString:@"notPasscodeAtStart"]) {
  213. if ([[rowDescriptor.value valueData] boolValue] == YES) {
  214. [CCUtility setNotPasscodeAtStart:true];
  215. } else {
  216. [CCUtility setNotPasscodeAtStart:false];
  217. }
  218. }
  219. if ([rowDescriptor.tag isEqualToString:@"enableTouchDaceID"]) {
  220. if ([[rowDescriptor.value valueData] boolValue] == YES) {
  221. [CCUtility setEnableTouchFaceID:true];
  222. } else {
  223. [CCUtility setEnableTouchFaceID:false];
  224. }
  225. }
  226. if ([rowDescriptor.tag isEqualToString:@"privacyScreen"]) {
  227. if ([[rowDescriptor.value valueData] boolValue] == YES) {
  228. [CCUtility setPrivacyScreenEnabled:true];
  229. } else {
  230. [CCUtility setPrivacyScreenEnabled:false];
  231. }
  232. }
  233. }
  234. #pragma mark -
  235. - (void)privacy:(XLFormRowDescriptor *)sender
  236. {
  237. [self deselectFormRow:sender];
  238. NCBrowserWeb* browserWebVC = [[UIStoryboard storyboardWithName:@"NCBrowserWeb" bundle:nil] instantiateInitialViewController];
  239. browserWebVC.urlBase = NCBrandOptions.shared.privacy;
  240. browserWebVC.isHiddenButtonExit = false;
  241. browserWebVC.titleBrowser = NSLocalizedString(@"_privacy_", nil);
  242. [self presentViewController:browserWebVC animated:YES completion:nil];
  243. }
  244. - (void)sourceCode:(XLFormRowDescriptor *)sender
  245. {
  246. [self deselectFormRow:sender];
  247. NCBrowserWeb* browserWebVC = [[UIStoryboard storyboardWithName:@"NCBrowserWeb" bundle:nil] instantiateInitialViewController];
  248. browserWebVC.urlBase = NCBrandOptions.shared.sourceCode;
  249. browserWebVC.isHiddenButtonExit = false;
  250. browserWebVC.titleBrowser = NSLocalizedString(@"_source_code_", nil);
  251. [self presentViewController:browserWebVC animated:YES completion:nil];
  252. }
  253. #pragma mark - Passcode
  254. - (void)didPerformBiometricValidationRequestInPasscodeViewController:(TOPasscodeViewController *)passcodeViewController
  255. {
  256. [[LAContext new] evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:[[NCBrandOptions shared] brand] reply:^(BOOL success, NSError * _Nullable error) {
  257. if (success) {
  258. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
  259. [CCUtility setPasscode:@""];
  260. [passcodeViewController dismissViewControllerAnimated:YES completion:nil];
  261. [self reloadForm];
  262. });
  263. }
  264. }];
  265. }
  266. - (void)passcodeSettingsViewController:(TOPasscodeSettingsViewController *)passcodeSettingsViewController didChangeToNewPasscode:(NSString *)passcode ofType:(TOPasscodeType)type
  267. {
  268. [CCUtility setPasscode:passcode];
  269. [passcodeSettingsViewController dismissViewControllerAnimated:YES completion:nil];
  270. [self reloadForm];
  271. }
  272. - (void)didTapCancelInPasscodeViewController:(TOPasscodeViewController *)passcodeViewController
  273. {
  274. [passcodeViewController dismissViewControllerAnimated:YES completion:nil];
  275. }
  276. - (BOOL)passcodeViewController:(TOPasscodeViewController *)passcodeViewController isCorrectCode:(NSString *)code
  277. {
  278. if ([code isEqualToString:[CCUtility getPasscode]]) {
  279. [CCUtility setPasscode:@""];
  280. [self reloadForm];
  281. return YES;
  282. }
  283. return NO;
  284. }
  285. - (void)passcode:(XLFormRowDescriptor *)sender
  286. {
  287. LAContext *laContext = [LAContext new];
  288. NSError *error;
  289. [self deselectFormRow:sender];
  290. if ([[CCUtility getPasscode] length] == 0) {
  291. passcodeSettingsViewController = [[TOPasscodeSettingsViewController alloc] init];
  292. passcodeSettingsViewController.hideOptionsButton = YES;
  293. passcodeSettingsViewController.requireCurrentPasscode = NO;
  294. passcodeSettingsViewController.passcodeType = TOPasscodeTypeSixDigits;
  295. passcodeSettingsViewController.delegate = self;
  296. [self presentViewController:passcodeSettingsViewController animated:YES completion:nil];
  297. } else {
  298. passcodeViewController = [[TOPasscodeViewController alloc] initPasscodeType:TOPasscodeTypeSixDigits allowCancel:true];
  299. passcodeViewController.delegate = self;
  300. passcodeViewController.keypadButtonShowLettering = false;
  301. if (CCUtility.getEnableTouchFaceID && [laContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {
  302. if (error == NULL) {
  303. if (laContext.biometryType == LABiometryTypeFaceID) {
  304. passcodeViewController.biometryType = TOPasscodeBiometryTypeFaceID;
  305. passcodeViewController.allowBiometricValidation = true;
  306. passcodeViewController.automaticallyPromptForBiometricValidation = true;
  307. } else if (laContext.biometryType == LABiometryTypeTouchID) {
  308. passcodeViewController.biometryType = TOPasscodeBiometryTypeTouchID;
  309. passcodeViewController.allowBiometricValidation = true;
  310. passcodeViewController.automaticallyPromptForBiometricValidation = true;
  311. } else {
  312. NSLog(@"No Biometric support");
  313. }
  314. }
  315. }
  316. [self presentViewController:passcodeViewController animated:YES completion:nil];
  317. }
  318. }
  319. #pragma mark -
  320. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  321. return NCGlobal.shared.heightCellSettings;
  322. }
  323. - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
  324. {
  325. NSString *sectionName;
  326. switch (section)
  327. {
  328. case 1: {
  329. sectionName = NSLocalizedString(@"_lock_protection_no_screen_footer_", nil);
  330. }
  331. break;
  332. case 4: {
  333. NSString *versionServer = [[NCManageDatabase shared] getCapabilitiesServerStringWithAccount:appDelegate.account elements:NCElementsJSON.shared.capabilitiesVersionString];
  334. NSString *themingName = [[NCManageDatabase shared] getCapabilitiesServerStringWithAccount:appDelegate.account elements:NCElementsJSON.shared.capabilitiesThemingName];
  335. NSString *themingSlogan = [[NCManageDatabase shared] getCapabilitiesServerStringWithAccount:appDelegate.account elements:NCElementsJSON.shared.capabilitiesThemingSlogan];
  336. NSString *versionNextcloud = [NSString stringWithFormat:[NCBrandOptions shared].textCopyrightNextcloudServer, versionServer];
  337. NSString *versionNextcloudiOS = [NSString stringWithFormat:[NCBrandOptions shared].textCopyrightNextcloudiOS, [[NCUtility shared] getVersionAppWithBuild:true]];
  338. NSString *nameSlogan = [NSString stringWithFormat:@"%@ - %@", themingName, themingSlogan];
  339. sectionName = [NSString stringWithFormat:@"\n%@\n\n%@\n%@", versionNextcloudiOS, versionNextcloud, nameSlogan];
  340. }
  341. break;
  342. }
  343. return sectionName;
  344. }
  345. @end