Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
3f5a8b70
Commit
3f5a8b70
authored
Apr 07, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) remove unused
parent
cdb5304d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
67 deletions
+0
-67
pfsense-utils.inc
src/etc/inc/pfsense-utils.inc
+0
-67
No files found.
src/etc/inc/pfsense-utils.inc
View file @
3f5a8b70
...
...
@@ -478,73 +478,6 @@ function update_alias_names_upon_change($section, $field, $new_alias_name, $orig
}
}
function
process_alias_unzip
(
$temp_filename
)
{
if
(
!
file_exists
(
"/usr/local/bin/unzip"
))
{
log_error
(
gettext
(
"Alias archive is a .zip file which cannot be decompressed because utility is missing!"
));
return
false
;
}
rename
(
"
{
$temp_filename
}
/aliases"
,
"
{
$temp_filename
}
/aliases.zip"
);
mwexec
(
"/usr/local/bin/unzip
{
$temp_filename
}
/aliases.tgz -d
{
$temp_filename
}
/aliases/"
);
unlink
(
"
{
$temp_filename
}
/aliases.zip"
);
$files_to_process
=
return_dir_as_array
(
"
{
$temp_filename
}
/"
);
/* foreach through all extracted files and build up aliases file */
$fd
=
@
fopen
(
"
{
$temp_filename
}
/aliases"
,
"w"
);
if
(
!
$fd
)
{
log_error
(
sprintf
(
gettext
(
'Could not open %s/aliases for writing!'
),
$temp_filename
));
return
false
;
}
foreach
(
$files_to_process
as
$f2p
)
{
$tmpfd
=
@
fopen
(
$f2p
,
'r'
);
if
(
!
$tmpfd
)
{
log_error
(
sprintf
(
gettext
(
'The following file could not be read %s from %s'
),
$f2p
,
$temp_filename
));
continue
;
}
while
((
$tmpbuf
=
fread
(
$tmpfd
,
65536
))
!==
FALSE
)
{
fwrite
(
$fd
,
$tmpbuf
);
}
fclose
(
$tmpfd
);
unlink
(
$f2p
);
}
fclose
(
$fd
);
unset
(
$tmpbuf
);
return
true
;
}
function
process_alias_tgz
(
$temp_filename
)
{
if
(
!
file_exists
(
'/usr/bin/tar'
))
{
log_error
(
gettext
(
"Alias archive is a .tar/tgz file which cannot be decompressed because utility is missing!"
));
return
false
;
}
rename
(
"
{
$temp_filename
}
/aliases"
,
"
{
$temp_filename
}
/aliases.tgz"
);
mwexec
(
"/usr/bin/tar xzf
{
$temp_filename
}
/aliases.tgz -C
{
$temp_filename
}
/aliases/"
);
unlink
(
"
{
$temp_filename
}
/aliases.tgz"
);
$files_to_process
=
return_dir_as_array
(
"
{
$temp_filename
}
/"
);
/* foreach through all extracted files and build up aliases file */
$fd
=
@
fopen
(
"
{
$temp_filename
}
/aliases"
,
"w"
);
if
(
!
$fd
)
{
log_error
(
sprintf
(
gettext
(
'Could not open %s/aliases for writing!'
),
$temp_filename
));
return
false
;
}
foreach
(
$files_to_process
as
$f2p
)
{
$tmpfd
=
@
fopen
(
$f2p
,
'r'
);
if
(
!
$tmpfd
)
{
log_error
(
sprintf
(
gettext
(
'The following file could not be read %s from %s'
),
$f2p
,
$temp_filename
));
continue
;
}
while
((
$tmpbuf
=
fread
(
$tmpfd
,
65536
))
!==
FALSE
)
{
fwrite
(
$fd
,
$tmpbuf
);
}
fclose
(
$tmpfd
);
unlink
(
$f2p
);
}
fclose
(
$fd
);
unset
(
$tmpbuf
);
return
true
;
}
function
process_alias_urltable
(
$name
,
$url
,
$freq
,
$forceupdate
=
false
)
{
global
$config
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment