Changeset 21441 for branches/version-2_12-dev/data/class/util/SC_Utils.php
- Timestamp:
- 2012/02/06 11:05:15 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/util/SC_Utils.php
r21420 r21441 40 40 if (!defined('ECCUBE_INSTALL')) { 41 41 $phpself = $_SERVER['PHP_SELF']; 42 if (strpos('/install/', $phpself) === false ) {42 if (strpos('/install/', $phpself) === false ) { 43 43 $path = substr($phpself, 0, strpos($phpself, basename($phpself))); 44 44 $install_url = SC_Utils_Ex::searchInstallerPath($path); … … 48 48 } 49 49 $path = HTML_REALDIR . 'install/' . DIR_INDEX_FILE; 50 if (file_exists($path)) {50 if (file_exists($path)) { 51 51 SC_Utils_Ex::sfErrorHeader('>> /install/' . DIR_INDEX_FILE . ' は、インストール完了後にファイルを削除してください。'); 52 52 } … … 187 187 function sfIsSuccess($objSess, $disp_error = true) { 188 188 $ret = $objSess->IsSuccess(); 189 if ($ret != SUCCESS) {190 if ($disp_error) {189 if ($ret != SUCCESS) { 190 if ($disp_error) { 191 191 // エラーページの表示 192 192 SC_Utils_Ex::sfDispError($ret); … … 197 197 // 「リファラ無」 の場合はスルー 198 198 // 「リファラ有」 かつ 「管理画面からの遷移でない」 場合にエラー画面を表示する 199 if ( 199 if (empty($_SERVER['HTTP_REFERER']) ) { 200 200 // TODO 警告表示させる? 201 201 // sfErrorHeader('>> referrerが無効になっています。'); … … 222 222 function sfPassLen($passlen){ 223 223 $ret = ""; 224 for ($i=0;$i<$passlen;true) {224 for ($i=0;$i<$passlen;true) { 225 225 $ret.="*"; 226 226 $i++; … … 253 253 // 前画面からPOSTされるuniqidが正しいものかどうかをチェック 254 254 $uniqid = $objSess->getUniqId(); 255 if ( 255 if (!empty($_POST['uniqid']) && ($_POST['uniqid'] === $uniqid) ) { 256 256 return true; 257 257 } else { … … 262 262 /* DB用日付文字列取得 */ 263 263 function sfGetTimestamp($year, $month, $day, $last = false) { 264 if ($year != "" && $month != "" && $day != "") {265 if ($last) {264 if ($year != "" && $month != "" && $day != "") { 265 if ($last) { 266 266 $time = "23:59:59"; 267 267 } else { … … 304 304 305 305 function sfGetCSVData($data, $prefix = ""){ 306 if ($prefix == "") {306 if ($prefix == "") { 307 307 $dir_name = SC_Utils_Ex::sfUpDirName(); 308 308 $file_name = $dir_name . date('ymdHis') .".csv"; … … 311 311 } 312 312 313 if (mb_internal_encoding() == CHAR_CODE) {313 if (mb_internal_encoding() == CHAR_CODE) { 314 314 $data = mb_convert_encoding($data,'SJIS-Win',CHAR_CODE); 315 315 } … … 334 334 $conv = ""; 335 335 $cnt = 1; 336 for ($cnt = 1; $cnt <= $max; $cnt++) {336 for ($cnt = 1; $cnt <= $max; $cnt++) { 337 337 if ($_POST[$keyname . $cnt] == "1") { 338 338 $conv.= "1"; … … 350 350 function sfMergeCheckBoxes($array, $max) { 351 351 $ret = ""; 352 if (is_array($array)) {353 foreach ($array as $val) {352 if (is_array($array)) { 353 foreach ($array as $val) { 354 354 $arrTmp[$val] = "1"; 355 355 } 356 356 } 357 for ($i = 1; $i <= $max; $i++) {358 if (isset($arrTmp[$i]) && $arrTmp[$i] == "1") {357 for ($i = 1; $i <= $max; $i++) { 358 if (isset($arrTmp[$i]) && $arrTmp[$i] == "1") { 359 359 $ret.= "1"; 360 360 } else { … … 371 371 function sfMergeParamCheckBoxes($array) { 372 372 $ret = ''; 373 if (is_array($array)) {374 foreach ($array as $val) {375 if ($ret != "") {373 if (is_array($array)) { 374 foreach ($array as $val) { 375 if ($ret != "") { 376 376 $ret.= "-$val"; 377 377 } else { … … 408 408 $arrRet = array(); 409 409 $len = strlen($val); 410 for ($i = 0; $i < $len; $i++) {411 if (substr($val, $i, 1) == "1") {410 for ($i = 0; $i < $len; $i++) { 411 if (substr($val, $i, 1) == "1") { 412 412 $arrRet[] = ($i + 1); 413 413 } … … 423 423 $conv = ""; 424 424 $cnt = 1; 425 for ($cnt = 1; $cnt <= $max; $cnt++) {425 for ($cnt = 1; $cnt <= $max; $cnt++) { 426 426 if ($_POST[$keyname . $cnt] == "1") { 427 427 $conv.= "1"; … … 442 442 $no = 1; 443 443 for ($cnt = 0; $cnt < $len; $cnt++) { 444 if ($keyname != "") {444 if ($keyname != "") { 445 445 $arr[$keyname . $no] = substr($val, $cnt, 1); 446 446 } else { … … 457 457 $max = count($arrList); 458 458 459 if ($len_max != "" && $max > $len_max) {459 if ($len_max != "" && $max > $len_max) { 460 460 $max = $len_max; 461 461 } 462 462 463 for ($cnt = 0; $cnt < $max; $cnt++) {464 if ($keysize != "") {463 for ($cnt = 0; $cnt < $max; $cnt++) { 464 if ($keysize != "") { 465 465 $key = SC_Utils_Ex::sfCutString($arrList[$cnt][$keyname], $keysize); 466 466 } else { … … 469 469 $val = $arrList[$cnt][$valname]; 470 470 471 if (!isset($arrRet[$key])) {471 if (!isset($arrRet[$key])) { 472 472 $arrRet[$key] = $val; 473 473 } … … 482 482 $max = count($arrList); 483 483 484 if ($len_max != "" && $max > $len_max) {484 if ($len_max != "" && $max > $len_max) { 485 485 $max = $len_max; 486 486 } 487 487 488 for ($cnt = 0; $cnt < $max; $cnt++) {489 if ($keysize != "") {488 for ($cnt = 0; $cnt < $max; $cnt++) { 489 if ($keysize != "") { 490 490 $key = SC_Utils_Ex::sfCutString($arrList[$cnt][$keyname], $keysize); 491 491 } else { … … 494 494 $val = $arrList[$cnt][$valname]; 495 495 496 if ($connect != "") {496 if ($connect != "") { 497 497 $arrRet[$key].= "$val".$connect; 498 498 } else { … … 507 507 if (count($array) > 0) { 508 508 $line = ""; 509 foreach ($array as $val) {509 foreach ($array as $val) { 510 510 if (!in_array($val, $arrPop)) { 511 511 if ($space) { … … 532 532 $line = ""; 533 533 if (count($array) > 0) { 534 foreach ($array as $key => $val) {534 foreach ($array as $key => $val) { 535 535 $val = mb_convert_encoding($val, CHAR_CODE, CHAR_CODE); 536 536 $line .= "\"".$val."\","; 537 537 } 538 538 $line = ereg_replace(",$", "\r\n", $line); 539 } else{539 } else { 540 540 return false; 541 541 } … … 556 556 // 期間指定 557 557 $error = 0; 558 if ( $start_month || $start_day || $start_year){558 if ($start_month || $start_day || $start_year) { 559 559 if ( ! checkdate($start_month, $start_day , $start_year) ) $error = 1; 560 560 } else { 561 561 $error = 1; 562 562 } 563 if ( $end_month || $end_day || $end_year){563 if ($end_month || $end_day || $end_year) { 564 564 if ( ! checkdate($end_month ,$end_day ,$end_year) ) $error = 2; 565 565 } 566 if ( ! $error ){566 if (! $error ) { 567 567 $date1 = $start_year ."/".sprintf("%02d",$start_month) ."/".sprintf("%02d",$start_day) ." 000000"; 568 568 $date2 = $end_year ."/".sprintf("%02d",$end_month) ."/".sprintf("%02d",$end_day) ." 235959"; … … 581 581 // 一致した値のキー名を取得 582 582 function sfSearchKey($array, $word, $default) { 583 foreach ($array as $key => $val) {584 if ($val == $word) {583 foreach ($array as $key => $val) { 584 if ($val == $word) { 585 585 return $key; 586 586 } … … 590 590 591 591 function sfGetErrorColor($val) { 592 if ($val != "") {592 if ($val != "") { 593 593 return "background-color:" . ERR_COLOR; 594 594 } … … 597 597 598 598 function sfGetEnabled($val) { 599 if (! $val ) {599 if (! $val ) { 600 600 return " disabled=\"disabled\""; 601 601 } … … 630 630 $real_tax = $tax / 100; 631 631 $ret = $price * $real_tax; 632 switch ($tax_rule) {632 switch ($tax_rule) { 633 633 // 四捨五入 634 634 case 1: … … 671 671 672 672 // 整数且つ0出なければ桁数指定を行う 673 if (SC_Utils_Ex::sfIsInt($adjust) and $pow > 1){673 if (SC_Utils_Ex::sfIsInt($adjust) and $pow > 1) { 674 674 $ret = (round($value * $adjust)/$adjust); 675 675 } … … 684 684 $real_point = $point_rate / 100; 685 685 $ret = $price * $real_point; 686 switch ($rule) {686 switch ($rule) { 687 687 // 四捨五入 688 688 case 1: … … 736 736 list($y, $m, $d, $H, $M) = preg_split("/[- :]/", $dbdate); 737 737 738 if (strlen($y) > 0 && strlen($m) > 0 && strlen($d) > 0) {738 if (strlen($y) > 0 && strlen($m) > 0 && strlen($d) > 0) { 739 739 if ($time) { 740 740 $str = sprintf("%04d/%02d/%02d %02d:%02d", $y, $m, $d, $H, $M); … … 751 751 function sfSwapArray($array, $isColumnName = true) { 752 752 $arrRet = array(); 753 foreach ($array as $key1 => $arr1) {753 foreach ($array as $key1 => $arr1) { 754 754 $index = 0; 755 foreach ($arr1 as $key2 => $val) {755 foreach ($arr1 as $key2 => $val) { 756 756 if ($isColumnName) { 757 757 $arrRet[$key2][$key1] = $val; … … 809 809 $add_point = $totalpoint - intval($use_point * ($point_rate / 100)); 810 810 811 if ($add_point < 0) {811 if ($add_point < 0) { 812 812 $add_point = '0'; 813 813 } … … 831 831 $ret = ""; 832 832 833 while ($str[$i] != "") {833 while ($str[$i] != "") { 834 834 $line[$cnt].=$str[$i]; 835 835 $i++; 836 if (strlen($line[$cnt]) > $size) {836 if (strlen($line[$cnt]) > $size) { 837 837 $line[$cnt].="<br />"; 838 838 $cnt++; … … 840 840 } 841 841 842 foreach ($line as $val) {842 foreach ($line as $val) { 843 843 $ret.=$val; 844 844 } … … 848 848 // 二回以上繰り返されているスラッシュ[/]を一つに変換する。 849 849 function sfRmDupSlash($istr){ 850 if (ereg("^http://", $istr)) {850 if (ereg("^http://", $istr)) { 851 851 $str = substr($istr, 7); 852 852 $head = "http://"; 853 } else if (ereg("^https://", $istr)) {853 } else if (ereg("^https://", $istr)) { 854 854 $str = substr($istr, 8); 855 855 $head = "https://"; … … 890 890 $ofp = fopen($outpath, "w+"); 891 891 892 while (!feof($ifp)) {892 while (!feof($ifp)) { 893 893 $line = fgets($ifp); 894 894 $line = mb_convert_encoding($line, $enc_type, 'auto'); … … 908 908 909 909 function sfCutString($str, $len, $byte = true, $commadisp = true) { 910 if ($byte) {911 if (strlen($str) > ($len + 2)) {910 if ($byte) { 911 if (strlen($str) > ($len + 2)) { 912 912 $ret =substr($str, 0, $len); 913 913 $cut = substr($str, $len); … … 917 917 } 918 918 } else { 919 if (mb_strlen($str) > ($len + 1)) {919 if (mb_strlen($str) > ($len + 1)) { 920 920 $ret = mb_substr($str, 0, $len); 921 921 $cut = mb_substr($str, $len); … … 948 948 } 949 949 950 if ($commadisp){950 if ($commadisp) { 951 951 $ret = $ret . "..."; 952 952 } … … 966 966 967 967 // 月の末日が締め日より少ない場合 968 if ($end_last_day < $close_day) {968 if ($end_last_day < $close_day) { 969 969 // 締め日を月末日に合わせる 970 970 $end_day = $end_last_day; … … 1001 1001 // 再帰的に多段配列を検索して一次元配列(Hidden引渡し用配列)に変換する。 1002 1002 function sfMakeHiddenArray($arrSrc, $arrDst = array(), $parent_key = "") { 1003 if (is_array($arrSrc)) {1004 foreach ($arrSrc as $key => $val) {1005 if ($parent_key != "") {1003 if (is_array($arrSrc)) { 1004 foreach ($arrSrc as $key => $val) { 1005 if ($parent_key != "") { 1006 1006 $keyname = $parent_key . "[". $key . "]"; 1007 1007 } else { 1008 1008 $keyname = $key; 1009 1009 } 1010 if (is_array($val)) {1010 if (is_array($val)) { 1011 1011 $arrDst = SC_Utils_Ex::sfMakeHiddenArray($val, $arrDst, $keyname); 1012 1012 } else { … … 1040 1040 $max = max( count( $keys ), count( $vals ) ); 1041 1041 $combine_ary = array(); 1042 for ($i=0; $i<$max; $i++) {1042 for ($i=0; $i<$max; $i++) { 1043 1043 $combine_ary[$keys[$i]] = $vals[$i]; 1044 1044 } … … 1053 1053 1054 1054 $arrBrothers = array(); 1055 foreach ($arrPID as $id) {1055 foreach ($arrPID as $id) { 1056 1056 // 親IDを検索する 1057 for ($i = 0; $i < $max; $i++) {1058 if ($arrData[$i][$id_name] == $id) {1057 for ($i = 0; $i < $max; $i++) { 1058 if ($arrData[$i][$id_name] == $id) { 1059 1059 $parent = $arrData[$i][$pid_name]; 1060 1060 break; … … 1062 1062 } 1063 1063 // 兄弟IDを検索する 1064 for ($i = 0; $i < $max; $i++) {1065 if ($arrData[$i][$pid_name] == $parent) {1064 for ($i = 0; $i < $max; $i++) { 1065 if ($arrData[$i][$pid_name] == $parent) { 1066 1066 $arrBrothers[] = $arrData[$i][$id_name]; 1067 1067 } … … 1077 1077 $arrChildren = array(); 1078 1078 // 子IDを検索する 1079 for ($i = 0; $i < $max; $i++) {1080 if ($arrData[$i][$pid_name] == $parent) {1079 for ($i = 0; $i < $max; $i++) { 1080 if ($arrData[$i][$pid_name] == $parent) { 1081 1081 $arrChildren[] = $arrData[$i][$id_name]; 1082 1082 } … … 1107 1107 $count++; // 無限ループ回避 1108 1108 $dir = dirname($path); 1109 if (ereg("^[/]$", $dir) || ereg("^[A-Z]:[\\]$", $dir) || $count > 256) {1109 if (ereg("^[/]$", $dir) || ereg("^[A-Z]:[\\]$", $dir) || $count > 256) { 1110 1110 // ルートディレクトリで終了 1111 1111 return; 1112 1112 } else { 1113 if (is_writable(dirname($dir))) {1114 if (!file_exists($dir)) {1113 if (is_writable(dirname($dir))) { 1114 if (!file_exists($dir)) { 1115 1115 mkdir($dir); 1116 1116 GC_Utils_Ex::gfPrintLog("mkdir $dir"); … … 1118 1118 } else { 1119 1119 SC_Utils_Ex::sfMakeDir($dir); 1120 if (is_writable(dirname($dir))) {1121 if (!file_exists($dir)) {1120 if (is_writable(dirname($dir))) { 1121 if (!file_exists($dir)) { 1122 1122 mkdir($dir); 1123 1123 GC_Utils_Ex::gfPrintLog("mkdir $dir"); … … 1131 1131 // ディレクトリ以下のファイルを再帰的にコピー 1132 1132 function sfCopyDir($src, $des, $mess = "", $override = false){ 1133 if (!is_dir($src)){1133 if (!is_dir($src)) { 1134 1134 return false; 1135 1135 } … … 1139 1139 1140 1140 // ディレクトリがなければ作成する 1141 if (!file_exists($des)) {1142 if (!mkdir($des, $mod[2])) {1141 if (!file_exists($des)) { 1142 if (!mkdir($des, $mod[2])) { 1143 1143 echo 'path:' . $des; 1144 1144 } … … 1147 1147 $fileArray=glob( $src."*" ); 1148 1148 if (is_array($fileArray)) { 1149 foreach ( $fileArray as $key => $data_ ){1149 foreach ($fileArray as $key => $data_ ) { 1150 1150 // CVS管理ファイルはコピーしない 1151 if (ereg("/CVS/Entries", $data_)) {1151 if (ereg("/CVS/Entries", $data_)) { 1152 1152 break; 1153 1153 } 1154 if (ereg("/CVS/Repository", $data_)) {1154 if (ereg("/CVS/Repository", $data_)) { 1155 1155 break; 1156 1156 } 1157 if (ereg("/CVS/Root", $data_)) {1157 if (ereg("/CVS/Root", $data_)) { 1158 1158 break; 1159 1159 } … … 1161 1161 mb_ereg("^(.*[\/])(.*)",$data_, $matches); 1162 1162 $data=$matches[2]; 1163 if ( is_dir( $data_ ) ){1163 if (is_dir( $data_ ) ) { 1164 1164 $mess = SC_Utils_Ex::sfCopyDir( $data_.'/', $des.$data.'/', $mess); 1165 } else{1166 if (!$override && file_exists($des.$data)) {1165 } else { 1166 if (!$override && file_exists($des.$data)) { 1167 1167 $mess.= $des.$data . ":ファイルが存在します\n"; 1168 1168 } else { 1169 if (@copy( $data_, $des.$data)) {1169 if (@copy( $data_, $des.$data)) { 1170 1170 $mess.= $des.$data . ":コピー成功\n"; 1171 1171 } else { … … 1183 1183 // 指定したフォルダ内のファイルを全て削除する 1184 1184 function sfDelFile($dir){ 1185 if (file_exists($dir)) {1185 if (file_exists($dir)) { 1186 1186 $dh = opendir($dir); 1187 1187 // フォルダ内のファイルを削除 1188 while ($file = readdir($dh)){1188 while ($file = readdir($dh)) { 1189 1189 if ($file == "." or $file == "..") continue; 1190 1190 $del_file = $dir . "/" . $file; 1191 if (is_file($del_file)){1191 if (is_file($del_file)) { 1192 1192 $ret = unlink($dir . "/" . $file); 1193 }else if (is_dir($del_file)) {1193 }else if (is_dir($del_file)) { 1194 1194 $ret = SC_Utils_Ex::sfDelFile($del_file); 1195 1195 } 1196 1196 1197 if (!$ret){1197 if (!$ret) { 1198 1198 return $ret; 1199 1199 } … … 1232 1232 fclose ($file); 1233 1233 // 権限を指定 1234 if ($permission != "") {1234 if ($permission != "") { 1235 1235 chmod($path, $permission); 1236 1236 } … … 1268 1268 // @versionの記載があるファイルからバージョンを取得する。 1269 1269 function sfGetFileVersion($path) { 1270 if (file_exists($path)) {1270 if (file_exists($path)) { 1271 1271 $src_fp = fopen($path, 'rb'); 1272 if ($src_fp) {1272 if ($src_fp) { 1273 1273 while (!feof($src_fp)) { 1274 1274 $line = fgets($src_fp); 1275 if (ereg("@version", $line)) {1275 if (ereg("@version", $line)) { 1276 1276 $arrLine = explode(" ", $line); 1277 1277 $version = $arrLine[5]; … … 1294 1294 function mbConvertKanaWithArray($array, $arrConvList) { 1295 1295 foreach ($arrConvList as $key => $val) { 1296 if (isset($array[$key])) {1296 if (isset($array[$key])) { 1297 1297 $array[$key] = mb_convert_kana($array[$key] ,$val); 1298 1298 } … … 1363 1363 // アルファベットと数字でソート 1364 1364 natcasesort($arrDir); 1365 foreach ($arrDir as $file) {1365 foreach ($arrDir as $file) { 1366 1366 // ./ と ../を除くファイルのみを取得 1367 if ($file != "." && $file != "..") {1367 if ($file != "." && $file != "..") { 1368 1368 1369 1369 $path = $dir."/".$file; … … 1374 1374 1375 1375 // ディレクトリとファイルで格納配列を変える 1376 if (is_dir($path)) {1376 if (is_dir($path)) { 1377 1377 $arrDirList[$cnt]['file_name'] = $file; 1378 1378 $arrDirList[$cnt]['file_path'] = $path; … … 1404 1404 */ 1405 1405 function sfGetDirSize($dir) { 1406 if (file_exists($dir)) {1406 if (file_exists($dir)) { 1407 1407 // ディレクトリの場合下層ファイルの総量を取得 1408 1408 if (is_dir($dir)) { … … 1445 1445 $dir = ereg_replace("/$", "", $dir); 1446 1446 // 最上位層を格納(user_data/) 1447 if (sfDirChildExists($dir)) {1447 if (sfDirChildExists($dir)) { 1448 1448 $arrTree[$cnt]['type'] = "_parent"; 1449 1449 } else { … … 1454 1454 $arrTree[$cnt]['count'] = $cnt; 1455 1455 // 初期表示はオープン 1456 if ($_POST['mode'] != '') {1456 if ($_POST['mode'] != '') { 1457 1457 $arrTree[$cnt]['open'] = lfIsFileOpen($dir, $tree_status); 1458 1458 } else { … … 1476 1476 function sfGetFileTreeSub($dir, $default_rank, &$cnt, &$arrTree, $tree_status) { 1477 1477 1478 if (file_exists($dir)) {1478 if (file_exists($dir)) { 1479 1479 if ($handle = opendir("$dir")) { 1480 1480 while (false !== ($item = readdir($handle))) $arrDir[] = $item; 1481 1481 // アルファベットと数字でソート 1482 1482 natcasesort($arrDir); 1483 foreach ($arrDir as $item) {1483 foreach ($arrDir as $item) { 1484 1484 if ($item != "." && $item != "..") { 1485 1485 // 文末の/を取り除く … … 1489 1489 if (is_dir($path)) { 1490 1490 $arrTree[$cnt]['path'] = $path; 1491 if (sfDirChildExists($path)) {1491 if (sfDirChildExists($path)) { 1492 1492 $arrTree[$cnt]['type'] = "_parent"; 1493 1493 } else { … … 1519 1519 */ 1520 1520 function sfDirChildExists($dir) { 1521 if (file_exists($dir)) {1521 if (file_exists($dir)) { 1522 1522 if (is_dir($dir)) { 1523 1523 $handle = opendir($dir); … … 1544 1544 function lfIsFileOpen($dir, $tree_status) { 1545 1545 $arrTreeStatus = explode('\|', $tree_status); 1546 if (in_array($dir, $arrTreeStatus)) {1546 if (in_array($dir, $arrTreeStatus)) { 1547 1547 return true; 1548 1548 } … … 1573 1573 function sfCreateFile($file, $mode = "") { 1574 1574 // 行末の/を取り除く 1575 if ($mode != "") {1575 if ($mode != "") { 1576 1576 $ret = @mkdir($file, $mode); 1577 1577 } else { … … 1592 1592 $fp = @fopen($filename, 'rb' ); 1593 1593 //ファイル内容を全て変数に読み込む 1594 if ($fp) {1594 if ($fp) { 1595 1595 $str = @fread($fp, filesize($filename)+1); 1596 1596 } … … 1606 1606 */ 1607 1607 function getCSVData($array, $arrayIndex) { 1608 for ($i = 0; $i < count($array); $i++) {1608 for ($i = 0; $i < count($array); $i++) { 1609 1609 // インデックスが設定されている場合 1610 if (is_array($arrayIndex) && 0 < count($arrayIndex)) {1611 for ($j = 0; $j < count($arrayIndex); $j++ ) {1610 if (is_array($arrayIndex) && 0 < count($arrayIndex)) { 1611 for ($j = 0; $j < count($arrayIndex); $j++ ) { 1612 1612 if ( $j > 0 ) $return .= ","; 1613 1613 $return .= "\""; … … 1615 1615 } 1616 1616 } else { 1617 for ($j = 0; $j < count($array[$i]); $j++ ) {1617 for ($j = 0; $j < count($array[$i]); $j++ ) { 1618 1618 if ( $j > 0 ) $return .= ","; 1619 1619 $return .= "\""; … … 1634 1634 $html = "<table>"; 1635 1635 $html.= "<tr>"; 1636 foreach ($array[0] as $key => $val) {1636 foreach ($array[0] as $key => $val) { 1637 1637 $html.="<th>$key</th>"; 1638 1638 } … … 1641 1641 $cnt = count($array); 1642 1642 1643 for ($i = 0; $i < $cnt; $i++) {1643 for ($i = 0; $i < $cnt; $i++) { 1644 1644 $html.= "<tr>"; 1645 foreach ($array[$i] as $val) {1645 foreach ($array[$i] as $val) { 1646 1646 $html.="<td>$val</td>"; 1647 1647 } … … 1989 1989 $salt = AUTH_MAGIC; 1990 1990 } 1991 if ( 1991 if (AUTH_TYPE == 'PLAIN') { 1992 1992 $res = $str; 1993 1993 } else { … … 2009 2009 if ($hashpass != '') { 2010 2010 if (AUTH_TYPE == 'PLAIN') { 2011 if ($pass === $hashpass) {2011 if ($pass === $hashpass) { 2012 2012 $res = true; 2013 2013 } … … 2019 2019 $hash = SC_Utils_Ex::sfGetHashString($pass, $salt); 2020 2020 } 2021 if ($hash === $hashpass) {2021 if ($hash === $hashpass) { 2022 2022 $res = true; 2023 2023 }
Note: See TracChangeset
for help on using the changeset viewer.